REST-API

The clockodo API allows you to connect clockodo to other systems. Accounting and project management applications or proprietary shell scripts are examples of useful mash-ups with clockodo.

api/absences: Manage absences

With this resource, you can query all absences, add new ones and edit, accept or decline existing ones.


Object type „absence“

Parameter Type Description
id integer ID of the absence
users_id integer ID of the corresponding co-worker
date_since string Start date in YYYY-MM-DD format
date_until string End date in YYYY-MM-DD format
status integer Status of the absence:
0: enquired/reported
1: approved
2: declined
3: approval cancelled
4: request cancelled Only with access rights for absence administration or in case of own absences
type integer Type of the absence:
1: Regular holiday
2: Special leaves
3: Reduction of overtime
4: Sick day Only with access rights for absence administration or in case of own absences
note string Note Only with access rights for absence administration or in case of own absences
count_days float (nur halbe und ganze Werte erlaubt) Amount of absence days (null for overtime reduction) Only with access rights for absence administration or in case of own absences
count_hours float Amount of hours of overtime reduction (null in other cases) Only with access rights for absence administration or in case of own absences
date_enquired string Date at which the absence request has been enquired in YYYY-MM-DD format Only with access rights for absence administration or in case of own absences
date_approved string Date at which the absence request has been approved, declined or cancelled in format YYYY-MM-DD Only with access rights for absence administration or in case of own absences
approved_by integer The ID of the co-worker who has approved, declined or cancelled the request Only with access rights for absence administration or in case of own absences

List absences

Request
GET /api/absences
Required parameters year (integer)
Response
{
  "absences": 
  {
    [object of type absence],
    [object of type absence], 
    ...
  }
}

Get a selected absence

Request
GET /api/absences/[ID]
Response
{
  "absence": [object of type absence]
}

Add a new absence / absence request

Request
POST /api/absences
Required parameters date_since, date_until, type
Optional parameters users_id (if not submitted, the absence will be added for the current API user), note, count_days (will be calculated if empty), count_days (will be calculated if empty)
Response
{
  "absence": [object of type absence]
}

Edit absence

Request
PUT /api/absences/[ID]
Required parameters keine
Optional parameters date_since, date_until, note, type, status, count_days (will be recalculated if you submit null), count_hours (will be recalculated if you submit null)
Response
{
  "absence": [object of type absence]
}

Delete absence

 

Only possible with access rights for absence administration and only if the absence has already been cancelled or declined.

Request
DELETE /api/absences/[ID]
Response
{
  "success": true
}