Developer documentation

Field definitions

get https://app.iteras.dk/api/fields/

The /api/fields/ endpoint enables you to retrieve information about the fields defined in Iteras.

Parameters

All parameters are optional.

  • id string
    Field ids, e.g. ?id=birthday&id=:Cancellation reason. Can be repeated. 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.

Return value

The data returned is an object with an array of field definitions, possibly empty, like this {"fields": [{"id": "birthday", ...}]}. Each field definition object may contain the following attributes:

  • name string
    The field name, e.g. Birthday.
  • id string
    The 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 in data.
  • type string
    The field type, e.g. text, choice, number, date, bool.
  • choices array

    The choices the field accepts, e.g. [{"name": "Personal", "customer_facing": true}]. Included only for fields with choices.

    • customer_facing bool
      Whether the choice is shown to customers in self-service, e.g. true.
    • name string
      The choice name, e.g. Personal.
    • help_text string
      Explanatory text shown next to the choice, e.g. Choose this if you subscribe yourself. Included if set.
    • identifier string
      The external identifier of the choice, used when setting the field, e.g. personal. Included if set.
{
  "fields": [
    {
      "name": "Title",
      "id": ":Title",
      "type": "text"
    },
    {
      "name": "Subscription type",
      "id": ":Subscription type",
      "type": "choice",
      "choices": [
        {
          "customer_facing": true,
          "name": "Personal"
        },
        {
          "customer_facing": true,
          "name": "Business"
        }
      ]
    }
  ]
}