Prerequisites
The Entity Labels feature must be enabled in the TrackTik portal first. Ask your Customer Success Manager about this.
Entity Labels
GET /entity-labels
{
"code": "PSN",
"label": "Position",
"status": "ACTIVE",
"id": 1
},
etc.
Entity Labels Availability Types
GET /entity-label-availability-types
{
"code": "POSITION",
"id": 1
}
Entity Label Availabilities
GET /entity-labels/{id}?include=availabilities
{
"code": "PSN",
"label": "Position",
"status": "ACTIVE",
"id": 1,
"availabilities": [
{
"code": "POSITION",
"id": 1
}
]
}
Assigning an Entity Label to a Position
Assining an Entity Label to a Position can be performed at the time the Position is being created or afterwards as a PATCH. The PATCH method is shown below.
Labels are associated to a position via their ID numbers (“id”: 1 in the example above), and must be provided as an array of integers.
PATCH /positions/{position ID}
{
"labels" : [1]
}
You need to complete the previous step of associating an Availability before you can assign an Entity Label to a Position. If you fail to do so and try to perform the Entity Label assignment below, you will get an error:
{ "entity_labels": [ "One of the label does not support availability type POSITION" ]
}
The [1] can be a comma separated list of IDs of other entity labels, like [1,7,2].
If you provide any ID number that does not exist, or it points to an Entity Label that was archived, you’ll get a validation error:
{
"entity_labels": [
"One of the label is either non-existent or archived"
]
}
Result:
GET /positions/{position ID}?include=labels
{
"name": "AB Guard",
"description": "",
"customId": "UA-1",
"status": "ACTIVE",
"account": 687,
"contract": 135,
"nonBillable": false,
"shiftMemo": "",
"beginDate": "2022-08-01T00:00:00+00:00",
"endDate": null,
"breakRule": 37,
"taxClass": null,
"payCodeLabel": null,
"taxLocation": null,
"id": 382,
==> "labels": [
{
"code": "PSN",
"label": "Position",
"status": "ACTIVE",
"id": 1
}
]
}