Events

As a developer, you can use the updatedge API to retrieve events from worker timelines and measures availability based on supplied time intervals.

Timeline Events

A worker's timeline event is represented in the API by the TimelineEvent object.

{
"id": "e7022a1c-e003-4f72-a7b0-74b4c58e19b5",
"eventType": "Working",
"start": "2019-09-01T06:30:00+00:00",
"end": "2019-09-01T16:30:00+00:00",
"createdAt": "2019-05-02T10:13:22.0077871+00:00",
"updatedAt": "2019-05-02T10:13:22.5390691+00:00"
...
}

Repeating Events

Workers have the option to specify repeat patterns for events. When they do this, the platform stores the original event they created along with parameters which denote the pattern of the repeat. Events which repeat have their instances generated by the API so you don't have to worry about calculating when the next iteration of an event will fall.

{
"id": "e7022a1c-e003-4f72-a7b0-74b4c58e19b5",
"instanceId": "e6802990-aa1d-4237-b3ea-a6a62bdaaaf3",
"eventType": "Working",
"start": "2019-09-01T06:30:00+00:00",
"end": "2019-09-01T16:30:00+00:00",
"repeats": true,
"repeatUntil": "2019-11-30T21:30:00+00:00",
"repeatInstance": true,
"repeatType" : "Monthly",
"createdAt": "2019-05-02T10:13:22.0077871+00:00",
"updatedAt": "2019-05-02T10:13:22.5390691+00:00"
...
}

You can determine whether the event is a generated recurrence by examining the repeats property and gain more insight with the repeatUntil and repeatInstance properties.

In addition, events which are generated for a recurrence have an instanceId property which is created specifically for the given request. It cannot be used to identify this recurrence on other endpoints and is purely present to ensure each TimelineEvent instance in the response has a unique reference (for example if the tooling you are rendering the events with requires one). The id property in this case refers to the original TimelineEvent.