Webhooks

Subscribes to change events for the assignments 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-assignments.read

Body properties

This list of properties can be sent in the request body.

Field Type Required Writable Description
destinationUrl string Yes Yes The URL where webhook events will be sent.
collectionName string Yes Yes The name of the collection to subscribe to (assignments).

Event properties

Field Type Required Writable Description
changeVersion string — Read-only Property to indicate the order of changes.
id integer — Read-only Internal unique identifier for the assignment.
person.id integer — Read-only Internal ID of the person who the assignment is for.
from string — Read-only Start date of the assignment (YYYY-MM-DD).
until string — Read-only End date of the assignment (YYYY-MM-DD).
startTimeInMinutes integer — Read-only Start time in minutes since midnight.
endTimeInMinutes integer — Read-only End time in minutes since midnight.
breakDurationInMinutes integer — Read-only Duration of the break in minutes.
comments string — Read-only Comments associated with the assignment.
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.
isRejected boolean — Read-only Whether the assignment has been rejected.

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

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

Creating a webhook for assignments

POST
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/webhooks

Request:

{
    "destinationUrl": "https://www.fictional-customer.com/protime/assignments",
    "collectionName": "assignments"
}