Update restrictions
Introduction
It is possible to update the restrictions of an activity definition with the PUT call. This allows you to control which activity definitions can be selected at different levels in the structure.
Tip
Check the Swagger page for more technical information on the endpoints.
Endpoint details
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/activity-structure-versions/{structureVersionId}/levels/{level}/activity-definitions/{activityDefinitionReference}/restrictions
URL parameters
These parameters need to be filled in when calling this endpoint.
| Parameter | Description |
|---|---|
<structureVersionId> |
The ID of the activity structure. Can be found in the configuration in myProtime. |
<level> |
Defines the level in the structure. |
<activityDefinitionReference> |
The internal ID or an external reference. |
Body properties
This list of properties is applicable for this endpoint.
| Property | Type | Description |
|---|---|---|
restrictions.level |
integer | The level in the activity structure to which the restriction applies. Required |
restrictions.activityDefinitions.id |
array | A list of unique identifiers for the activity definitions that are restricted at the specified level. Required |
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.
Note
Check the query options below the endpoint on the Swagger page for the relevant external references.
Caution
There are some restrictions on the characters allowed in URL requests. See the fetching resources page for more information.
Examples
Update restrictions with single level
Example updating restrictions for activity definition with internal ID 38fc2206-b51f-434a-9c36-9e0esfc5e70e:
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/activity-structure-versions/b2347a7a-d60d-446f-b03b-7es2cc8c3281/levels/3/activity-definitions/38fc2206-b51f-434a-9c36-9e0esfc5e70e/restrictions
{
"restrictions": [
{
"level": 1,
"activityDefinitions": [
{
"id": "a7d853ea-89eb-4735-83d1-b891c6fde398"
},
{
"id": "22d320ed-f6ed-44bd-b7b1-fe58f518960c"
}
]
}
]
}Update restrictions with multiple levels
Example updating restrictions across multiple levels:
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/activity-structure-versions/b2347a7a-d60d-446f-b03b-7es2cc8c3281/levels/3/activity-definitions/38fc2206-b51f-434a-9c36-9e0esfc5e70e/restrictions
{
"restrictions": [
{
"level": 1,
"activityDefinitions": [
{
"id": "a7d853ea-89eb-4735-83d1-b891c6fde398"
},
{
"id": "22d320ed-f6ed-44bd-b7b1-fe58f518960c"
}
]
},
{
"level": 3,
"activityDefinitions": [
{
"id": "b2593723-9574-4659-8367-706645454367"
}
]
}
]
}Clear all restrictions
Example clearing all restrictions for activity definition with internal ID 22d320ed-f6ed-44bd-b7b1-fe58f518960c:
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/activity-structure-versions/b2347a7a-d60d-446f-b03b-7es2cc8c3281/levels/2/activity-definitions/22d320ed-f6ed-44bd-b7b1-fe58f518960c/restrictions
{
"restrictions": []
}