Absence definitions
Introduction
Through the API there’s a possibility to retrieve absence definitions.
Properties
Property | Type | Description |
---|---|---|
id |
integer | Internal unique identifier for the absence definition. |
name.default |
string | Default name value of the absence definition. |
name.translations |
string | A list of translated names of the definition by language code. |
code |
string | An absence code used for this definition. |
friendlyName.default |
string | Default friendly name value for this definition shown to users. |
friendlyName.translations |
string | A list of translated friendly names by language code. |
friendlyCode.default |
string | Default friendly code value for this definition shown to users. |
friendlyCode.translations |
string | A list of translated friendly codes by language code. |
allowedDurations |
array | List of allowed durations (Unknown , FullDay , HalfDay , Interval , Duration ). |
isEnabled |
boolean | Indicates if the absence definition is enabled in myProtime. |
isReasonForClocking |
boolean | Indicates if this absence can be used as a reason for clockings. |
absenceGroup.id |
integer | The ID of the associated absence group. |
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 section.
Example with a custom external reference:
GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/absence-definitions/123?externalReferences=(absence-definitions,customAbsenceCode)
Endpoints
Below you can find the supported endpoints for this data collection.
GET an absence definition by reference
You can retrieve an absence definition by the internal ID or an external reference using the GET call. Internal IDs for absence definitions can be found by listing all absence definitions using the GET collection endpoint.
GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/absence-definitions/{absenceDefinitionReference}
Example with an internal Id:
GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/absence-definitions/9
Example with an absence code:
GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/absence-definitions/O200?externalReferences=(absence-definitions,@absence-code)
GET a list of absence definitions
You can retrieve a list of absence definitions.
GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/absence-definitions
Delta
It’s possible to retrieve changes with the delta. Check the Delta page for more general and critical information on how to use this feature.
Example for absence definitions with a delta:
GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/absence-definitions?delta
Webhooks
It’s possible to retrieve change-events with webhooks. Check the Webhooks page for more general and critical information on how to use this feature.
Example for creating a webhook for absence definitions:
POST https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/webhooks
{
"destinationUrl": "https://www.fictional-customer.com/protime/absence-definitions",
"collectionName": "absence-definitions"
}