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/targethours: Manage target hours

With this resource you can manage all target hour settings.


Abstract object type „targethoursRow“

Parameter Type Description
id integer The ID of the target hour settings
type string Type of target hours:
'weekly': weekly target hours
'monthly': monthly target hours
date_since string Date from which on the target hours apply Format YYYY-MM-DD
date_until string|null Date until which the target hours apply Format YYYY-MM-DD
compensation_monthly float Automatic time compensation per month in hours
users_id integer The related employee's ID

Object type „targethoursRowWeekly“

Object type „targethoursRow“ extended by:

Parameter Type Description
monday float target hours for Monday
tuesday float target hours for Tuesday
wednesday Mittwoch target hours for Wednesday
thursday float target hours for Thursday
friday float target hours for Friday
saturday float target hours for Saturday
sunday float target hours for Sunday
absence_fixed_credit boolean true if credited absence hours are applied against the average target hours, false if credited absence hours match the target hours of the specific day
compensation_daily float Automatic time compensation per day in minutes

Object type „targethoursRowMonthly“

Object type „targethoursRow“ extended by:

Parameter Type Description
monthly_target float Monthly target hours to attain
workday_tuesday boolean Is Tuesday a work day?
workday_wednesday boolean Is Wednesday a work day?
workday_thursday boolean Is Thursday a work day?
workday_friday boolean Is Friday a work day?
workday_saturday boolean Is Saturday a work day?
workday_sunday boolean Is Sunday a work day?
workday_monday boolean Is Monday a work day?

List target hours

Request
GET /api/targethours
Optional parameters users_id (integer) Restrict data to this user
Response
{
  "targethours": 
  {
    [object of type targethoursRow],
    [object of type targethoursRow], 
    ...
  }
}

Request single target hour setting

Request
GET /api/targethours/[ID]
Response
{
  "targethours": [object of type targethoursRow]
}

Add target hours

Request
POST /api/targethours
Required parameters for type: weekly users_id, type, monday, tuesday, wednesday, thursday, friday, saturday, sunday, compensation_daily, compensation_monthly
Required parameters for type: monthly users_id, type, workday_monday, workday_tuesday, workday_wednesday, workday_thursday, workday_friday, workday_saturday, workday_sunday, monthly_target, compensation_monthly
Optional parameters date_until
Response
{
  "targethours": [object of type targethoursRow]
}

Edit target hours

Request
PUT /api/targethours/[ID]
Required parameters for type: weekly users_id, type, monday, tuesday, wednesday, thursday, friday, saturday, sunday, compensation_daily, compensation_monthly
Required parameters for type: monthly users_id, type, workday_monday, workday_tuesday, workday_wednesday, workday_thursday, workday_friday, workday_saturday, workday_sunday, monthly_target, compensation_monthly
Optional parameters date_until
Response
{
  "targethours": [object of type targethoursRow]
}

Delete target hours

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