Inputs: a template's labelled variables
POST /inputs reads a template and lists its labelled variables, in the order they are defined: the values that
can be given for it. Use it to build a form for a template, or to check what a template asks for before running it.
The body is just the template: template (or source), and units if it isn't in millimetres. No values are needed.
Example
POST /inputs
X-API-KEY: your-api-key
Content-Type: application/json
{ "template": "L=400,\"Length\"\nW=300,\"Width\"\nP1=[L,0]\nP2=[L,W]\nP3=[0,W]\nPOLYLINE @1,[P0,P1,P2,P3],TRUE,0" }
{
"description": "",
"inputs": [
{ "name": "L", "label": "Length", "kind": "Number", "value": 400, "choices": [] },
{ "name": "W", "label": "Width", "kind": "Number", "value": 300, "choices": [] },
{ "name": "D", "label": "Depth", "kind": "Number", "value": 300, "choices": [] }
]
}
Each input has its kind: Number, Text, Toggle (true or false) or Choice. A choice lists what can be chosen
in choices, and its value is the place of the one chosen in the template (from 0). description is what the
template says it is: the comment lines it starts with. L, W and D, the drawing's standard sizes, are labelled in
every drawing, so they are always listed.
A template that can't be read is answered 400, saying why.
See also: API, Drawing, Run Parametric.