GET /custom-fields
If you want to include custom fields in your message to the POST /repair endpoint first of all you will need to collect information about which custom fields have been created and are in use on a site by site basis.
Calling the GET /custom-fields endpoint provides information on which fields are in use at the site that created the API key you are using in your authentication. All sites within an MSO and the MSO entity itself will use the same set of custom fields, however as we do not expose site MSO membership via the API currently, it is recommended to treat each entity independently when designing your setup flow.
The endpoint returns the following information:
Key | Description |
|---|---|
| The shortcode of the custom field - this is not the label displayed in the UI, but the key used by the API. |
| The field type eg: Number, DateTime, String, String[] |
| The description entered by the admin in BodyShop Booster when creating the custom field. |
If it is not clear which shortcode is used for a specific custom field, ask the BodyShop Booster admin to look in Admin → Custom Fields (or Admin → Statuses → Repair Statuses for custom date fields associated with custom statuses). The next API version will contain this field label used in the CRM to make things easier.
Single / Multiple Select Fields
If a field is a single select or multiple select type, then we will also provide an array of supported values for that field in the response.
It is possible to send values that do not match supported values, and these will be shown in the CRM view for the user. However, at present this will cause a validation error if the user edits and saves inside the CRM without changing the unsupported value to a supported one first, so this is not recommended.
Sending Custom Fields
Once you have the fieldName and fieldType from the GET /custom-fields endpoint, you can simply include the key / value pairs for the custom fields in your POST to the /repair endpoint.
You will need to nest these correctly, inside customFieldsInfo and inside the correct parent description element following the structure given in the GET /custom-fields response.
The openApiCustomFields element only has these child elements:
customerDetailsrepairDetailsvehicleDetailsestimateDetailsinsuranceDetailsrepairDates
And these elements will be the only parents when sending the custom field key/value pairs.
Note that the fieldTypes String[] and String are different - when fieldType is String[] the value in the POST message must be constructed as an array. There is no limit on the number of values in the array beyond a total character limit of 2048.
Example Response from GET /custom-fields
{
"data": {
"openApiCustomFields": {
"customerDetails": [
{
"fieldName": "customerRecordCustomField",
"fieldType": "Number",
"description": ""
}
],
"repairDetails": [
{
"fieldName": "exampleRepairMultiSelect",
"fieldType": "String[]",
"description": "",
"supportedValues": [
"thom",
"jonny",
"phil",
"ed",
"colin"
]
},
{
"fieldName": "exampleRepairSingleSelect",
"fieldType": "String",
"description": "",
"supportedValues": [
"Red",
"Orange",
"Yellow",
"Green",
"Blue",
"Indigo"
]
},
{
"fieldName": "exampleRepairCustomField",
"fieldType": "String",
"description": ""
}
],
"vehicleDetails": [],
"estimateDetails": [],
"insuranceDetails": [],
"repairDates": [
{
"fieldName": "qaCompleteDate",
"fieldType": "DateTime",
"description": "When QA is completed"
},
{
"fieldName": "scheduledQaCompleteDate",
"fieldType": "DateTime",
"description": "When QA is completed"
}
]
}
}
}Custom Statuses
It is possible in BodyShop Booster to define custom statuses that are then shown in the status bar above each repair record. Each custom status, when created, has two associated date fields created at the same time - one for its Scheduled date, and one for its Actual date. To update a status you’ll need to send the actual date associated with that status - see Dates & Statuses in BodyShop Booster for more on how this works.
To see which custom fields are associated with which custom statuses, you will need to have a BodyShop Booster admin look in the Admin → Statuses → Repair Statuses page, then on the detail sidebar for each custom status, look in the “Date Field ShortCode - Actual” value.
All date fields given in the openApiCustomFields- repairDates section are related to custom statuses.