Absence Types
The API functions for Absence Types in Papershift
Get Absence Types
Get existing absence types from your Papershift account
URL MethodGET
ParametersParemeter | Type | Required |
---|---|---|
api_token | String | required |
location_id | Integer | required if location_external_id is not provided |
location_external_id | String | required if location_id is not provided |
page | Integer | optional |
Returns a paginated list of absence types associated with the specified location.
Example{
"api_token": "XXXX",
"location_id": 1,
"page": 1
}
function getTargetHours() {
$.ajax({
url: "https://app.papershift.com/public_api/v1/absence_types?api_token=XXXX&location_external_id=ABC&page=2",
type: 'GET',
dataType: 'json',
complete: function (data) {
console.log(data.responseText);
}
});
}
{
"absence_types": [
{
"id": 1,
"title": "Sick",
"company_id": 1,
"created_at": "2025-01-07T07:44:47Z",
"updated_at": "2025-01-07T07:54:06Z",
"target_to_zero": false,
"regard_holidays": true,
"affect_vacation_times": false,
"color": "#1abc9c",
"affect_evaluations": false,
"external_id": "",
"status": "active",
"editable": false,
"assign_new_users": true,
"evaluation_calculation_setting": null,
"fixed_value": 0,
"check_n_week_average": false,
"n_week_average_length": null,
"n_week_average_method": "working_sessions",
"remove_assignments_on_confirm": true,
"remove_working_sessions_on_confirm": true,
"remove_availabilities_on_confirm": false,
"resettable_for_employees": false,
"applicable_for_employees": true,
"applicable_for_admins": true,
"applicable_for_owners": true
},
{
"id": 2,
"title": "Holiday",
"company_id": 1,
"created_at": "2025-01-07T07:53:57Z",
"updated_at": "2025-01-07T07:53:57Z",
"target_to_zero": false,
"regard_holidays": false,
"affect_vacation_times": false,
"color": "#8e44ad",
"affect_evaluations": true,
"external_id": "",
"status": "active",
"editable": true,
"assign_new_users": true,
"evaluation_calculation_setting": "absent_to_target",
"fixed_value": 0.0,
"check_n_week_average": false,
"n_week_average_length": null,
"n_week_average_method": "working_sessions",
"remove_assignments_on_confirm": true,
"remove_working_sessions_on_confirm": true,
"remove_availabilities_on_confirm": false,
"resettable_for_employees": false,
"applicable_for_employees": true,
"applicable_for_admins": true,
"applicable_for_owners": true
}
],
"page_number": 1,
"total_pages": 1,
"next_page": null
}
Updated 3 days ago