Get Workforce Absences Unique Values
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/unique-values', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/unique-values"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/unique-values \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"field": "<string>",
"total_count": 123,
"values": {
"value": {},
"label": {},
"count": 123
}
}Get Workforce Absences Unique Values
List the distinct values of a filterable absence field, with a count per value
GET
/
v1
/
own_workforce_absenteeisms_accidents
/
unique-values
Get Workforce Absences Unique Values
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/unique-values', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/unique-values"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/unique-values \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"field": "<string>",
"total_count": 123,
"values": {
"value": {},
"label": {},
"count": 123
}
}← Own Workforce API
Return the distinct values of one filterable field on absence and accident records, each with a label and the number of rows carrying it.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faQuery Parameters
string
required
The field to enumerate.Available values:
file_idAny other value is rejected with 422. In particular type is not enumerable here — it is free text with a long tail of values, so it is not offered as a filter.Example: field=file_idResponse
string
Echo of the field that was queried
integer
Number of distinct values returned
array[object]
Example
curl -X GET "https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/unique-values?field=file_id" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import os
import requests
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
}
response = requests.get(
"https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/unique-values",
headers=headers,
params={"field": "file_id"},
)
for item in response.json()["values"]:
print(f"{item['label']}: {item['count']} records")
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID
};
axios.get('https://api.dcycle.io/v1/own_workforce_absenteeisms_accidents/unique-values', {
headers,
params: { field: 'file_id' }
})
.then(({ data }) => {
data.values.forEach(item => console.log(`${item.label}: ${item.count} records`));
})
.catch(error => console.error(error));
Successful Response
{
"field": "file_id",
"total_count": 1,
"values": [
{
"value": "dd44ee55-ff66-4077-8188-99aabbccddee",
"label": "absences_2026.csv",
"count": 96
}
]
}
Common Errors
401 Unauthorized
Cause: the key is invalid, or it does not belong to the organization inx-organization-id — the two are looked up as a pair. A request carrying no credentials at all answers AUTH_REQUIRED instead.
{
"detail": "Invalid API key for organization",
"code": "INVALID_API_KEY"
}
403 Forbidden
Cause: the key’s owner is not an enabled member of the organization inx-organization-id.
{
"detail": "Logged User is not Member of Organization",
"code": "LOGGED_USER_NOT_MEMBER"
}
422 Unprocessable Entity
Cause:field missing, or set to something other than file_id.
{
"detail": [
{
"type": "enum",
"loc": ["query", "field"],
"msg": "Input should be 'file_id'"
}
]
}
Related Endpoints
List absences paginated
Apply the value as
file_id[]Trainings unique values
The same endpoint for trainings
Was this page helpful?