Before diving in, be sure to familiarize yourself with the feature by reading this linked visual guide about the TrackTik web application. If the endpoints are missing from your domain/rest/v1 documentation it's because the feature hasn't been enabled and you should reach out to your Customer Success Manager to request it.
To create a Report Template Field Group and to add Report Template Fields to the group, the Report Template Fields must have already been created, and are not already grouped.
Create A Report Template Fields Group
The first step is to create the group. If a group already exists and you only want to add hem to that group, skip to the next section.
POST /report-template-field-groups
{
"name": "API group",
"reportTemplate": 2892
}When this step is completed, you'll get back a response with an id generated for the record. Take note of that id.
{
"id": 2902,
"name": "API group",
"reportTemplate": 2892
}Add Report Template Fields To The Group
The second step is to add Report Template Fields to the Group via a dedication action. Note the use of the id number from the previous step.
The IDs of the Report Template Fields must also be known to shape the payload, and those can be looked up via the parent Report Template:
GET /report-templates/2892?include=reportFields
Now to add the Report Template Fields to the newly created group:
POST /report-template-field-groups/2902/actions/add-report-fields
{
"reportFields":
[
2900,2901
]
}The result is that Report Template Fields 2900 and 2901 will be assigned to the group who's ID is 2902, and you can verify this by looking them up using a different endpoint for grouped fields:
GET /report-template-field-group-fields?sort=-id
Result:
{
==> "fieldGroup": 2902,
==> "id": 2901,
"label": "extrafield2",
"name": "f_2901",
"type": "TEXT",
"required": false,
"adminOnly": false,
"displayOrder": 0,
"extra": "",
"list": null,
"listItems": null,
"isDispatcherField": false,
"fieldTag": "",
"confidential": false,
"repeatable": false
},
{
==> "fieldGroup": 2902,
==> "id": 2900,
"label": "extrafield1",
"name": "f_2900",
"type": "TEXT",
"required": false,
"adminOnly": false,
"displayOrder": 0,
"extra": "",
"list": null,
"listItems": null,
"isDispatcherField": false,
"fieldTag": "",
"confidential": false,
When fields are grouped, they will look like this in the TrackTik web application: