Webhooks
Subscribes to change events for the activity durations collection.
Caution
Read the Webhooks page. There is important information on required implementation!
Tip
Check the Swagger page for more technical information on the endpoints.
Endpoint details
POST
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/webhooks
Headers: Authorization: Bearer {token}, User-Agent: {agent}
Scope: connector-protimeapi-webhooks.write and connector-protimeapi-activity-durations.read
Body properties
| Field | Type | Required | Writable | Description |
|---|---|---|---|---|
destinationUrl |
string | Yes | Yes | The URL where webhook notifications will be sent. |
collectionName |
string | Yes | Yes | The name of the collection to subscribe to (activity-durations). |
Event properties
| Field | Type | Required | Writable | Description |
|---|---|---|---|---|
changeVersion |
string | — | Read-only | Property to indicate the order of changes. |
id |
integer | — | Read-only | Unique identifier for the activity duration. |
person.id |
integer | — | Read-only | Unique identifier of the person linked to this duration. |
date |
string | — | Read-only | Date of the activity duration (YYYY-MM-DD). |
durationInMinutes |
integer | — | Read-only | Duration in minutes for the activity. |
activityLevels.level |
integer | — | Read-only | A list of levels in the activity structure of the registered activity definition. |
activityLevels.activityDefinition.id |
string | — | Read-only | Unique identifier for the activity definition registered. |
shiftDefinition.id |
integer | — | Read-only | Unique identifier for the shift definition, if a shift is linked to the duration. |
absenceDefinition.id |
integer | — | Read-only | Unique identifier for the absence definition, if an absence is linked to the duration. |
counterDefinitions.id |
integer | — | Read-only | A list of unique identifiers for the counter definitions or multiple definitions, if one or more counters are linked to this duration. |
request.id |
string | — | Read-only | Unique identifier for the request, if the duration was requested. |
status |
string | — | Read-only | Status of the activity duration (Unknown, Auto, Manual). |
isAuthorized |
boolean | — | Read-only | Indicates if the activity duration is authorized. |
External references
The endpoint supports predefined and custom external references. See the external references page for details.
The following collections are supported for this endpoint:
| Collection | Predefined | Custom |
|---|---|---|
people |
@badge-number, @employee-number |
Supported |
activity-definitions |
@data-entry-code, @external-reference |
Supported |
absence-definitions |
@absence-code |
Supported |
counter-definitions |
@counter-code |
Supported |
shift-definitions |
@shift-code |
Supported |
Error responses
| Status | Condition |
|---|---|
400 |
Invalid destination URL or unknown collection name |
401 |
Missing or invalid access token, or insufficient scope |
Success response
201 Created with webhookKey and validUntil in the response body.
Examples
A webhook for activity durations
Example for creating a webhook for activity durations:
POST
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/webhooks
{
"destinationUrl": "https://www.fictional-customer.com/protime/activity-durations",
"collectionName": "activity-durations"
}