Fields
The fields endpoint provides the configuration of required fields for a specific subcategory. These fields must be included when creating a lead for that subcategory. Each subcategory has its own unique set of fields with specific types and requirements.
The field model
The field model defines the structure and requirements for data collection in leads.
Properties
- Name
type
- Type
- string
- Description
Type of the field. Can be either 'text' or 'choice'.
- Name
name
- Type
- string
- Description
Identifier for the field. This name must be used when submitting the field value in a lead.
- Name
label
- Type
- string
- Description
Display label for the field to show in the frontend interface.
- Name
choices
- Type
- array
- Description
Array of available options when type is 'choice'. Not present for text fields.
- Name
multiple
- Type
- boolean
- Description
Whether multiple values can be selected for this field.
List subcategory fields
Retrieve the list of required fields for a specific subcategory. The field configuration obtained from this endpoint specifies the exact field names and structure that must be used when creating a lead for the corresponding subcategory.
Request
curl https://app.offerteadviseur.nl/api/categories/1/subcategories/1/fields \
-H "Authorization: Bearer eyJ..." \
-H "Accept: application/json"
Response
{
"data": [
{
"type": "choice",
"name": "year_of_construction",
"label": "Roof Bouwjaar woning",
"multiple": false,
"choices": [
"Na 2000",
"Tussen 1970-2000",
"Tussen 1930-1970",
"Voor 1930"
]
},
// ...
]
}