SG Ground Truth

GET /schema/<Type>/fields

get_schema_type_fields

Every field on one type with its data_type, editable and mandatory. The expensive call at 48KB and ~330ms, so fetch the types you need and never loop the /schema listing into it.

API

Params

part value
project_id optional. Adds hidden_values to every list and status field (probe 009) and makes every visible.value that project's (probe 115)

Sample requests

r = c.get("/schema/Version/fields")

Keyed by programmatic field name. On the probed site, Version has 71 fields in 47958 bytes:

{
  "data": {
    "code": {
      "name":        { "value": "Version Name", "editable": true },
      "entity_type": { "value": "Version",      "editable": false },
      "data_type":   { "value": "text",         "editable": false },
      "editable":    { "value": true,           "editable": false },
      "mandatory":   { "value": true,           "editable": false },
      "unique":      { "value": false,          "editable": false },
      "properties":  { "default_value": { "value": null, "editable": false } }
    }
  }
}

Which fields a client may write:

f = c.get("/schema/Version/fields").json()["data"]
print([k for k, v in f.items() if v["editable"]["value"]])

Response codes

status when
200 the type is enabled
404 Entity type 'X' does not exist.

Edge cases

  • mandatory is not the create contract. code reads mandatory: true and a create omitting it succeeds at 201 with a server-invented name; project reads mandatory: false and a create omitting it is 400. Read the create contract from the entity-type card, not from this flag.
  • Every value is wrapped in {value, editable}, and the outer editable says whether you may change the property, not whether you may write the field. data["code"]["editable"]["value"] is the one that answers "can I write this".
  • Adding project_id changes two things: hidden_values on list and status fields, and visible.value on every field the project hides. On the probed site Version differs by 22 bytes and no visible, while Shot reads 12 fields hidden in one project and 15 in another, none at site scope (probe 115).
  • A project_id that does not exist is a 200 with every field visible, not an error.
  • 48KB and about 330ms per type. Never loop this over the /schema listing.

Every entry on this site is the output of a probe in probes/. The corpus is generated by running those probes against a live Flow Production Tracking site, not written from memory.

Not affiliated with or endorsed by Autodesk. Flow Production Tracking is their product; this is an independent record of how its REST API answers.