Counter definitions


Introduction

Through the API there’s a possibility to retrieve counter definitions.

Properties

Property Type Description
id integer Unique identifier for the counter definition.
name.default string Default name of the counter definition.
name.translations string A list of translated names for supported languages.
code string A chosen code for the counter definition.
friendlyName.default string Default friendly name for the counter definition, shown to users if no translation is available.
friendlyName.translations object A list of translated friendly names for supported languages, shown to users.
friendlyCode.default string Default friendly code for the counter definition.
friendlyCode.translations string A list of translated friendly codes for supported languages.
isEnabled boolean Indicates if the counter definition is enabled in myProtime.
counterGroup.id integer Unique identifier for the counter group that this definition is linked to.
unit string The unit type for the counter definition (Unknown, Interval, Duration, Instance).

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/counter-definitions/766?externalReferences=(counter-groups,counterCode)

Endpoints

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

GET a counter definition by reference

You can retrieve a counter definition by the internal ID or an external reference using the GET call. Internal IDs for counter definitions can be found by listing all counter definitions using the GET collection endpoint.

GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/counter-definitions/{counterDefinitionReference}

Example with an internal Id:
GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/counter-definitions/9
Example with an external reference:
GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/counter-definitions/O200?externalReferences=(counter-groups,counterCode)

GET a list of counter definitions

You can retrieve a list of counter definitions using a filter.

GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/counter-definitions

Filter requirements

Example with enabled counter definitions and a counter definition group:
GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/counter-definitions?filter=enabled eq true and counter-definition-group in (1)

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 for more general and critical information on how to use this feature.

Example for counter definitions with a delta:
GET https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/counter-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 counter definitions:
POST https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/webhooks

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