Activity durations


Introduction

Through the API there’s a possibility to retrieve activity durations.

Properties

Property Type Description
id integer Unique identifier for the activity duration.
person.id integer Unique identifier of the person linked to this duration.
date string Date of the activity duration (YYYY-MM-DD).
durationInMinutes integer Duration in minutes for the activity.
activityLevels.level integer A list of levels in the activity structure of the registered activity definition.
activityLevels.activityDefinition.id string Unique identifier for the activity definition registered.
absenceDefinition.id integer Unique identifier for the absence definition, if an absence is linked to the duration.
request.id string Unique identifier for the request, if the duration was requested.
counterDefinitions.id integer A list of unique identifiers for the counter definitions or multiple definitions, if one or more counters are linked to this duration.
shiftDefinition.id integer Unique identifier for the shift definition, if a shift is linked to the duration.
status string Status of the activity duration (Unknown, Auto, Manual, Calendar, Deleted, Default).
isAuthorized boolean Indicates if the activity duration is authorized.

External references

It’s possible to use predefined external references and custom external references. More information can be found on the External References Page

For a list of predefined external references, see the external reference options page.

Example with predefined external references:
GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/activity-durations?filter=date ge '2025-01-01' and date le '2025-01-05' &externalReferences=(people,@employee-number)(activity-definitions,@data-entry-code)(absence-definitions,@absence-code)(counter-definitions,@counter-code)

Endpoints

Below you can find the supported endpoints for this data collection.

GET an activity duration by Id

You can retrieve an activity duration by the internal ID using the GET call. Internal IDs for activity durations can be found by listing all activity durations using the GET collection endpoint.

GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/activity-durations/{id}

  • <id>
    • The Id’s are available in the location header after a successful POST call

GET a list of activity durations

You can retrieve a list of activity durations using a filter.

GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/activity-durations

Filter requirements

Example of a GET call with an external reference (employee number):

GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/activity-durations?filter=person in (1,2,3) and date ge '2025-01-01' and date le '2025-01-05' &externalReferences=(people,@employee-number)

Check the Fetching Resources page on how to use the filter.

Delta

It’s possible to retrieve changes with the delta. Check the Delta page how to use the delta.

Filter when using the delta

Example for activity durations with a delta:
GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/clockings?filter=date ge '2025-01-01'&externalReferences=(people,@employee-number)&delta

Webhooks

It’s possible to retrieve change-events with webhooks. Check the Webhooks page how to use this.