Field definitions
https://app.iteras.dk/api/fields/
The API key must allow "Field definitions".
Lists the fields of the account with ID, name, type, choices and the condition operators each can be filtered with; condition_operator_parameters says which parameters each operator takes. used_for says what a field belongs to.
Parameters
All parameters are optional.
-
id string
Field IDs, repeating the parameter for each, e.g.
id=birthday&id=:Cancellation reason. The ID is either the field name with a colon prepended or if defined the external identifier of the field.Remember to URL encode the IDs.
-
used_for string
Only the fields of one kind of object, e.g.
used_for=customer. The kinds are the values the fields come back with inused_for, and the error for an unknown one lists them. -
include_builtins bool Defaults to
falseInclude the built-in fields too, e.g.
nameandemailon a customer, which conditions can filter on as well, e.g.include_builtins=true.
Return value
The data returned is an object with an array of field definitions,
possibly empty, like this {"fields": [{"id": "birthday", ...}], "condition_operator_parameters": {...}}.
Each field definition object may contain the following attributes:
-
name stringThe field name, e.g.
Birthday. -
id stringThe field id, either the field name with a colon prepended or the external identifier of the field, e.g.
birthday. Use it to refer to the field, e.g. as a key indata. -
type stringThe field type, e.g.
text,choice,number,date,bool. -
used_for stringWhat the field belongs to, e.g.
customerorsubscription, as in theused_forparameter. -
condition_operators arrayThe operators a condition on the field can use, e.g.
["equal", "contains"]. -
choices array
The choices the field accepts, e.g.
[{"name": "Personal", "customer_facing": true}]. Included only for fields with choices.-
customer_facing boolWhether the choice is shown to customers in self-service, e.g.
true. -
name stringThe choice name, e.g.
Personal. -
help_text stringExplanatory text shown next to the choice, e.g.
Choose this if you subscribe yourself. Included if set. -
identifier stringThe external identifier of the choice, used when setting the field, e.g.
personal. Included if set.
-
condition_operator_parameters has, for each operator, the parameters a condition with it takes besides field and operator, e.g. {"contains": ["text"]}.
{
"fields": [
{
"name": "Title",
"id": ":Title",
"type": "text",
"used_for": "customer",
"condition_operators": [
"filledin",
"notfilledin",
"contains",
"notcontains",
"equal",
"notequal",
"oneof",
"notoneof"
]
},
{
"name": "Subscription type",
"id": ":Subscription type",
"type": "choice",
"choices": [
{
"customer_facing": true,
"name": "Personal"
},
{
"customer_facing": true,
"name": "Business"
}
],
"used_for": "subscription",
"condition_operators": [
"filledin",
"notfilledin",
"in",
"notin"
]
}
],
"condition_operator_parameters": {
"contains": ["text"],
// ...
}
}