TimeRocket Public API

Introduction

Pricing

All queries incur transaction points, which are billed on a monthly basis. We are happy to assist you in optimizing your query strategy. Please contact us to discuss your options.

Miscellaneous

API endpoints with the attribute (PREVIEW) are currently not available but will be available in the future.

API endpoints with the attribute [DEPRECATED] are currently available but will get removed in the future.

Version 1.0

Initialize Pairing Process

https://api.timerocket.ch/public/v1.0/pairing/init

To use the TimeRocket Public API, you have to obtain an authorization token that links your device/application with a TimeRocket tenant.

Attention: We have implemented a new way to obtain an API authorization token. You can simply create one in the TimeRocket app under "Settings -> Devices / APIs". If you do so, you don't have to follow the steps "Initialize Pairing Process" and "Complete Pairing Process".

The legacy way to obtain an authorization token is to register your device/application. The code you receive in this response must be used to link your device/application via the TimeRocket GUI.
Visit our knowledge base for further information.

The code has an expiry.

Response

Field Type
deviceId Guid, all uppercase
code Alphanumeric six char long string
expiry UTC date and time in the format yyyy-MM-ddTHH:mm

Example Request

curl --location --request POST 'https://api.timerocket.ch/public/v1.0/pairing/init'

Example Response

{ "deviceId": "E6393822-BC45-4543-B14B-873626438111", "code": "123456", "expiry": "2021-01-30T16:47" }

Complete Pairing Process

https://api.timerocket.ch/public/v1.0/pairing/complete

Once you pair your application/device with a tenant using the code from https://api.timerocket.ch/public/v1.0/pairing/init via the TimeRocket GUI, you have to complete the pairing process.

In the response, you get a bearer token. This token has to be used for every request performed by your device/application.

Please store this token securely as it's similar to a password.

Request

Field Type Description
deviceId Guid, all uppercase The deviceId you received by calling https://api.timerocket.ch/public/v1.0/pairing/init

Response

Field Type
token UTF-8 string with unspecified length

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/pairing/complete' \ --header 'Content-Type: application/json' \ --data '{ "deviceId": "E6393822-BC45-4543-B14B-873626438111" }'

Example Response

{ "token": "eyJkZXZpZCI6IjcyODg0OUVBLTg5NTAtNEZGMi05QzYzLUMwMUM1QThCOTUxRCIsInRva2lkIjoiMjk2ZjBjMmMtZDA0My00ODMwLWJlNmYtMTRhYmJmMWVlMjQzIn0" }

Errors

Code not linked Status Code 428 - Precondition Required
Invalid request Status Code 417 - Expectation Failed

Import Custom IDs

https://api.timerocket.ch/public/v1.0/customIds

Your system has its own IDs mapped to a fingerprint or badge. Everytime your application wants to create a TimeRocket timestamp you have to provide this ID. In order to map your ID to a TimeRocket employee ID you first have to import your IDs into TimeRocket.

With this request you're creating a custom ID catalogue with some custom IDs mapped to this catalogue. These IDs must then get mapped manually to the respective employees via the TimeRocket GUI.

Request

Field Type Description
catalogueName String with max. 255 characters, only letters and digits are allowed Specified by your device/application
labels Array of type label Provides labels/translations for your catalogueName
labels[].language ISO 639-1 language code Language code of label
labels[].label UTF-8 string Label/translation of catalogue name in the specified language
ids Array of strings (the length of a string is limited to 255 characters, only letters and digits are allowed) These are the IDs associated by your device/application to a badge or fingerprint

Response

Field Type
catalogueName String with max. 255 characters

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/customIds' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{token}}' \ --data '{ "catalogueName": "catalogueNameOfYourChoice", "labels": [ { "language": "en", "label": "my application name" }, { "language": "de", "label": "Name meiner Applikation" } ], "ids": [ "alphaNumericID", "a123456xy", "b654321yx" ] }'

Example Response

{ "catalogueName": "catalogue-name-of-your-choice" }

Errors

Catalogue name already exists Status Code 409 - Conflict
Invalid request Status Code 417 - Expectation Failed

Add Additional Custom ID

https://api.timerocket.ch/public/v1.0/customIds/{{catalogueName}}

Appends a custom ID to an already existing catalogue.

Request

Field Type Description
id String with max. length 255, only letters and digits are allowed ID associated by your device/application to a badge or fingerprint
email OPTIONAL FIELD: string representing an email address If this field is set, it must contain a valid email address which will be compared with all the email addresses set in the TimeRocket system under the tenant linked to your token. If a match was found, the matching employee will automatically get linked to the custom ID you provided and the response status code will be 201. If no matching email address was found, only the custom ID will be created (no linking) and the response status code will be 202

Response

Field Type
id String with max. length 255, only letters and digits are allowed

Example Request

curl --location -g --request PUT 'https://api.timerocket.ch/public/v1.0/customIds/{{catalogueName}}' \ --header 'Authorization: Bearer {{token}}' \ --data '{ "id": "alphaNumericID" }'

Example Response

{ "id": "alphaNumericID" }

Responses

Success without email address Status Code 202 - Accepted
Email address does match Status Code 201 - Created
Email address does not match Status Code 202 - Accepted
Custom ID already exists Status Code 409 - Conflict
Catalogue does not exist Status Code 428 - Precondition Required

Query Employees

https://api.timerocket.ch/public/v1.0/employees

Queries all employees with their custom catalogue information.

Response

Field Type Description
employeeId GUID The TimeRocket ID of the employee.
name string The full name of the employee.
email string The email address of the employee.
catalogues array The custom-IDs per catalogue of the employee
catalogues[].catalogueId string Name of your custom id catalogue.
catalogues[].customId string Assosiated custom id to this employee.
catalogues[].catalogueType string Type of Catalogue (Badge / Employee)

Example Request

curl --location 'http://localhost:58339/public/v1.0/employees' \ --header 'Authorization: Bearer {{token}}'

Example Response

[ { "employeeId": "A7E5CAF9-758C-4278-A828-8038891D2517", "name": "Hansruedi Lüthi", "email": "h.luethi@firma.ch", "catalogues": [ { "catalogueId": "myEmployeeCatalogueName", "customId": "abc001", "catalogueType": "employee" } ] }, { "employeeId": "3B6AFFC6-5733-4492-A181-D88017DC3BA4", "name": "Emma Wunder", "email": "e.wunder@firma.ch", "catalogues": [ { "catalogueId": "myBadgeCatalogueName", "customId": "9xyz0", "catalogueType": "Badge" } ] }, { "employeeId": "4DEF82CD-DDBA-4BD1-A0BB-ED5A6CD03F82", "name": "Patrik Kant", "email": "p.kant@firma.ch", "catalogues": [] } ]

Query Attendance Information

https://api.timerocket.ch/public/v1.0/attendance?workday={workday}&language={language}&employeeId={employeeId}&catalogueName={catalogueName}&customId={customId}

Queries the current attendance information of an employee via her/his custom ID.

Request

* Either use catalogueName in combination with customId or just use employeeId

Field Type Description
workday ISO 2014 date representation in the format yyyy-MM-dd Specifies for which date the information will get queried (normally you want the information of todays date)
catalogueName* String with max. 255 characters, only letters and digits are allowed The catalogueName you specified in https://api.timerocket.ch/public/v1.0/customIds
customId* String with max. length 255, only letters and digits are allowed The ID associated by your device/application to a badge or fingerprint of the person you want to query
employeeId* Guid, all uppercase TimeRocket Employee ID
language ISO 639-1 language code The language in which the response shall be rendered

Response

Field Type Description
currentTime UTC date and time in the format yyyy-MM-ddTHH:mm Current server time
timeStamps All time stamps of the queried person on the specified workday
timeStamps[].id Guid, all uppercase ID of a time stamp
timeStamps[].time UTC date and time incl. time offset to UTC and origin time zone (tz db name) in the format yyyy-MM-ddTHH:mm:ss +/-hh:mm () Point in time when the timestamp happened
todaysAttendance Integer representing minutes Attendance of the queried person on the specified workday (only closed presence blocks).
hasConversionRate Boolean Specifies if there is a conversion rate for this person
conversionRate OPTIONAL FIELD: integer representing minutes Duration of a day specified for the queried person (if a persons workday duration is 8 hours and 12 minutes, the conversionRate would be 492)
accounts All accounts of the queried person with the values on the specified workday (only closed presence blocks).
accounts[].id Guid, all uppercase ID of account
accounts[].label UTF-8 string Account label in the queried language
accounts[].total Integer representing minutes Account value on the specified workday (only closed presence blocks).
status Status of the queried person on the specified workday as of now (currentTime)
status[].id Guid, all uppercase See status IDs
status[].label UTF-8 string Label of the current status in the queried language

Account IDs

ID Description
D9BEF6C1-C272-461F-93E1-D987C0D8CEE8 Extra hours
54A4181D-255D-4CE0-9450-672B0D86E209 Overtime
CAB20D1C-567B-4991-AEEF-E2B0A976AF67 Vacation

Status IDs

ID Description
520B2CB1-6CFC-4A9B-9279-F9A23BF598F6 Present
C073D1EA-3295-464F-BBEA-A33AE4734F01 Absent
7FD7FEDB-3458-47D7-BA85-1C167F050493 Unknown

Params

workday {workday}Date in the format yyyy-MM-dd
language {language}Language code
employeeId {employeeId}GUID: TimeRocket employee id
catalogueName {catalogueName}Name of your custom id catalogue
customId {customId}Your custom id

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/attendance?workday=2021-01-05&language=de&employeeId=A7E5CAF9-758C-4278-A828-8038891D2517' \ --header 'Authorization: Bearer {{token}}'

Example Response

{ "currentTime": "2021-01-30T16:47", "timeStamps": [ { "id": "233894D2-963B-4B3A-940E-3D2B17EF465F", "time": "2021-01-30T06:35:00 +01:00 (Europe/Zurich)" }, { "id": "0DB1BEDF-DC14-4686-91A6-BCB82B52EA93", "time": "2021-01-30T10:16:00 +01:00 (Europe/Zurich)" } ], "todaysAttendance": 221, "hasConversionRate": true, "conversionRate": 492, "accounts": [ { "id": "54A4181D-255D-4CE0-9450-672B0D86E209", "label": "Überstunden", "total": 849 }, { "id": "CAB20D1C-567B-4991-AEEF-E2B0A976AF67", "label": "Ferien", "total": 9510 } ], "status": { "id": "C073D1EA-3295-464F-BBEA-A33AE4734F01", "label": "Abwesend" } }

Query Attendance Range Information

https://api.timerocket.ch/public/v1.0/attendance/range?employeeIds={employeeIds}&from={from}&to={to}

Queries all employees and their attendance times per day

Request

Field Type Description
employeeIds Comma-separated Guids The TimeRocket ID of the employees.
from ISO 2014 date representation in the format yyyy-MM-dd Specifies the "from" date of the query range.
to ISO 2014 date representation in the format yyyy-MM-dd Specifies the "to" date of the query range.

Response

** if the workday is today and there is an odd number of timestamps, the presence and actual time are filled up to the current instant

Field Type Description
employeeId GUID The TimeRocket ID of the employee.
employeeName string Name of employee
workday ISO 2014 date representation in the format yyyy-MM-dd The workday the presence are associated with.
presence integer representing minutes Presence on the respective day
(2 hours and 12 minutes = 132) **
actualTime integer representing minutes Actual time (presence plus absence) on the respective day
(2 hours and 12 minutes = 132) **
targetTime integer representing minutes Target time (per contract) on the respective day
(2 hours and 12 minutes = 132)

Params

employeeIds {employeeIds}Comma-separated TimeRocket employee ids
from {from}Date in the format yyyy-MM-dd
to {to}Date in the format yyyy-MM-dd

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/attendance/range?employeeIds=A7E5CAF9-758C-4278-A828-8038891D2517%2CBB6AFFC6-5733-4492-A181-D88017DC3BA4&from=2023-05-01&to=2023-05-31' \ --header 'Authorization: Bearer {{token}}' \ --header 'Content-Type: application/json'

Example Response

[ { "employeeId": "DE7DFAAF-0B4C-4238-9CE1-54D623B1E30C", "employeeName": "Muster Max", "workday": "2020-01-10", "presence": 42, "actualTime": 43, "targetTime": 44 } ]

Query Timeblocks

https://api.timerocket.ch/public/v1.0/timeblocks?employeeIds={employeeIds}&from={from}&to={to}

Queries the timeblocks of all specified employees.

Request

Field Type Description
employeeIds Comma-separated Guids The TimeRocket ID of the employees.
from ISO 2014 date representation in the format yyyy-MM-dd Specifies the "from" date of the query range.
to ISO 2014 date representation in the format yyyy-MM-dd Specifies the "to" date of the query range.

Response

Field Type Description
employeeId GUID The TimeRocket ID of the employee.
workday ISO 2014 date representation in the format yyyy-MM-dd The workday the time blocks are associated with.
timeblocks array The time blocks of the workday with all details (these time blocks can overlap)
timeblocks[].start Information on the start time of the time block
timeblocks[].start.time string (HH:mm) Time at which the time block started
timeblocks[].start.workdayShift int Specifies by how much the time stamp deviates from the workday (0 = same day, -1 = previous day, 1 = following day).
timeblocks[].end OPTIONAL
string (HH:mm)
Information on the end time of the time block.
Only available for closed blocks. If, e.g. the employee is still present, the latest working block will not have an end.
timeblocks[].end.time string (HH:mm) Time at which the time block ended
timeblocks[].end.workdayShift int Specifies by how much the time stamp deviates from the workday (0 = same day, -1 = previous day, 1 = following day).
timeblocks[].duration integer representing minutes Duration of a time block specified for the queried person (2 hours and 12 minutes = 132)
timeblocks[].kind string Working = Working Block

Presence = Presence (first stamp to last stamp)

CoreTimeViolation = Violation of core time

Break Stamped = Stamped break by employee

Break Extension = Stamped break was extended by rule

Break Generated = Pause was automatically entered by the system

FlexibleTimeViolation = Violation of flexible time

BlockingTimeViolation = Violation of blocking time
sequentialWorkingBlocks The time blocks of the working day with the effectively credited times (these time blocks do not overlap)
sequentialWorkingBlocks[].start
sequentialWorkingBlocks[].start.time string (HH:mm) Time at which the time block started
sequentialWorkingBlocks[].start.workdayShift int Specifies by how much the time stamp deviates from the workday (0 = same day, -1 = previous day, 1 = following day).
sequentialWorkingBlocks[].end
sequentialWorkingBlocks[].end.time string (HH:mm) Time at which the time block started
sequentialWorkingBlocks[].end.workdayShift int Specifies by how much the time stamp deviates from the workday (0 = same day, -1 = previous day, 1 = following day).
sequentialWorkingBlocks[].duration integer representing minutes Duration of a time block specified for the queried person (2 hours and 12 minutes = 132)

Params

employeeIds {employeeIds}Comma-separated TimeRocket employee ids
from {from}Date in the format yyyy-MM-dd
to {to}Date in the format yyyy-MM-dd

Example Request

curl --location --request POST 'https://api.timerocket.ch/public/v1.0/timeblocks?employeeIds=A7E5CAF9-758C-4278-A828-8038891D2517%2CBB6AFFC6-5733-4492-A181-D88017DC3BA4&from=2023-05-01&to=2023-05-31' \ --header 'Authorization: Bearer {{token}}' \ --header 'Content-Type: application/json'

Example Response

[ { "employeeId": "00000000-0000-0000-0000-000000000001", "workday": "2023-01-01", "timeblocks": [ { "start": { "time": "08:00", "workdayShift": 0 }, "end": { "time": "12:00", "workdayShift": 0 }, "duration": 240, "kind": "Working" } ], "sequentialWorkingBlocks": [ { "start": { "time": "08:00", "workdayShift": 0 }, "end": { "time": "12:00", "workdayShift": 0 }, "duration": 240 } ] } ]

Query Employee States

https://api.timerocket.ch/public/v1.0/attendance/employeeStates?employeeIds={employeeIds}&catalogueName={catalogueName}&customIds={customIds}

Queries the current attendance time state of a set of employees.

Request

* Either use catalogueName in combination with customIds or just use employeeIds

Field Type Description
employeeIds* Comma-separated Guids TimeRocket ID of the employees.
catalogueName* String with max. 255 characters, only letters and digits are allowed Name of your custom id catalogue
customIds* Comma-separated Strings with max. length 255, only letters and digits are allowed ID associated by your device/application to a badge or fingerprint of the persons you want to query.

Response

* Either employeeId is returned or if you used catalogueName customId will be returned

Field Type Description
currentTime UTC date and time in the format yyyy-MM-ddTHH:mm:ssZ Current server time.
employees array Requested employees with details.
employees[].employeeId* Guid, all uppercase TimeRocket Employee ID.
employees[].customId* String with max. length 255, only letters and digits are allowed ID associated by your device/application to a badge or fingerprint of the persons you want to query.
employees[].state String with possible values:
- Present
- Absent
- Unknown
Status of the queried person as of now (currentTime).

Params

employeeIds {employeeIds}Comma-separated TimeRocket employee ids
catalogueName {catalogueName}Name of your custom id catalogue
customIds {customIds}Comma-separated custom ids

Example Request (with employeeIds)

curl --location 'https://api.timerocket.ch/public/v1.0/attendance/employeeStates?employeeIds=A7E5CAF9-758C-4278-A828-8038891D2517%2CBB6AFFC6-5733-4492-A181-D88017DC3BA4' \ --header 'Authorization: Bearer {{token}}' \ --header 'Content-Type: application/json'

Example Response (with employeeIds)

{ "currentTime": "2021-01-30T16:47:23Z", "employees": [ { "employeeId": "A7E5CAF9-758C-4278-A828-8038891D2517", "state": "Present" }, { "employeeId": "BB6AFFC6-5733-4492-A181-D88017DC3BA4", "state": "Absent" } ] }

Example Request (with catalogueName and customIds)

curl --location --request POST 'https://api.timerocket.ch/public/v1.0/attendance/employeeStates?catalogueName=foreignSystem&customIds=abc001%2Cabc005' \ --header 'Authorization: Bearer {{token}}' \ --header 'Content-Type: application/json'

Example Response (with catalogueName and customIds)

{ "currentTime": "2021-01-30T16:47:23Z", "employees": [ { "customId": "abc001", "state": "Present" }, { "customId": "abc005", "state": "Absent" } ] }

Query Employee Information

https://api.timerocket.ch/public/v1.0/customIds/{{catalogueName}}/{{customId}}/employee

Queries the information about the employee linked to a specific custom ID.

Response

Field Type Description
formattedEmployeeName UTF-8 string Name of employee
birthDate ISO 2014 date representation in the format yyyy-MM-dd Date of birth of the queried employee

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/customIds/foreignCatalogue/abcd001/employee' \ --header 'Authorization: Bearer {{token}}'

Example Response

{ "formattedEmployeeName": "Hansruedi Lüthi", "birthdate": "1975-06-05" }

Create Timestamp

https://api.timerocket.ch/public/v1.0/attendance/timeTracking

Creates a timestamp for a TimeRocket employee via her/his custom ID.

Request

Field Type Description
entryTime UTC date and time incl. time offset to UTC and origin time zone (tz db name) in the format yyyy-MM-ddTHH:mm:ss +/-hh:mm ( Date and time of the timestamp (does not have to be the same as current time)
catalogueName String with max. 255 characters, only letters and digits are allowed CatalogueName you specified in https://api.timerocket.ch/public/v1.0/customIds
customId String with max. length 255, only letters and digits are allowed The ID associated by your device/application to a badge or fingerprint of the person you want to query

Response

Field Type Description
id Guid, all uppercase ID of timestamp

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/attendance/timeTracking' \ --header 'Authorization: Bearer {{token}}' \ --data '{ "entryTime": "2021-01-30T06:35:00 +01:00 (Europe/Zurich)", "catalogueName": "catalogueNameUsedForImport", "customId": "a123456xy" }'

Example Response

{ "id": "233894D2-963B-4B3A-940E-3D2B17EF465F" }

Response Codes

Success Status Code 201 - Created
Custom ID and/or Catalogue Name not linked Status Code 428 - Precondition Required
Custom ID is not linked to employee Status Code 406 - Not Acceptable
Invalid datetime Status Code 400 - Bad Request

Query Time Categories Duration

https://api.timerocket.ch/public/v1.0/timeCategoriesDuration

Queries all employees and their time categories with durations per day

Request

Field Type Description
employeeIds array The TimeRocket ID of the employees.
timeCategoryIds array The TimeRocket ID of the time category.
language string language code:
de = German
en = English
fr = French
it = Italian
from ISO 2014 date representation in the format yyyy-MM-dd Specifies the "from" date of the query range.
to ISO 2014 date representation in the format yyyy-MM-dd Specifies the "to" date of the query range.

Response

Field Type Description
employeeId GUID The TimeRocket ID of the employee.
employeeName string Name of employee
workday ISO 2014 date representation in the format yyyy-MM-dd The workday the presence are associated with.
zeitart GUID The TimeRocket ID of the time category
zeitartName string Name of time cateogory
duration integer representing minutes duration of time category (2 hours and 12 minutes = 132)

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/timeCategoriesDuration' \ --header 'Authorization: Bearer {{token}}' \ --header 'Content-Type: application/json' \ --data '{ "employeeIds": [ "A7E5CAF9-758C-4278-A828-8038891D2517", "BB6AFFC6-5733-4492-A181-D88017DC3BA4" ], "timeCategoryIds": [ "C7E5CAF9-758C-4278-A828-8038891D2517", "CB6AFFC6-5733-4492-A181-D88017DC3BA4" ], "language": "de", "from": "2023-05-01", "to": "2023-05-31" }'

Example Response

[ { "employeeId": "A7E5CAF9-758C-4278-A828-8038891D2517", "employeeName": "Max Muster", "workday": "2023-01-01", "zeitartId": "C7E5CAF9-758C-4278-A828-8038891D2517", "zeitartName": "Ferien", "duration": 400 } ]

Query Calendar Entries

https://api.timerocket.ch/public/v1.0/planning/calendarEntries

Queries the calendar entries of employees.

Request

Field Type Description
employeeIds OPTIONAL FIELD: array The TimeRocket ID of the employees. Data for all employees is returned when omitted.
from ISO 2014 date representation in the format yyyy-MM-dd Specifies the "from" date of the query range.
to ISO 2014 date representation in the format yyyy-MM-dd Specifies the "to" date of the query range.
language string One of the languages defined for the tenant ("de", "en", "it", "fr")

Response

Field Type Description
employeeId GUID The TimeRocket ID of the employee.
employeeName string Name of employee.
employeeCalendar array Holds the calendar entries of the employee's calendar.
employeeCalendar.from ISO 2014 date representation in the format yyyy-MM-dd The date the calendar entry starts.
employeeCalendar.to ISO 2014 date representation in the format yyyy-MM-dd The date the calendar entry ends. Same as start for single-day entries.
employeeCalendar.timeType GUID ID of the time type.
employeeCalendar.timeTypeLabel string Label of the time type.
employeeCalendar.timeFrame string The kind of time frame. See below for details.
employeeCalendar.timeFrameAdditionalData string Additional data for the time frame. See below for details.
employeeCalendar.label string Always empty for the employee's calendar. Label of the calendar entry for organisation calendars.
organisationCalendars array The organisation calendars relevant for the employee.
organisationCalendars.calendarId GUID ID of the organisation calendar.
organisationCalendars.name string Name of the organisation owning this calendar.
organisationCalendars.calendarEntries array Calendar entires of the organisation calendar.
organisationCalendars.calendarEntries. ... array same fields as employeeCalendar (please see above)

Possible timeFrame values with their timeFrameAdditionalData

timeFrame timeFrameAdditionalData Description
WholeDay empty The calendar entry spans the whole day.
FixTimeOnPercentage duration The calendar entry duration is calculated as follows: duration * workload percentage, e.g. 120min * 80%.
FixTime duration A fixed amount of time. Duration is in minutes.
HalfDay Morning or Afternoon The calendar entry spans either the morning or afternoon.
LoyaltyBonusCredit empty A loyality bonus.
RemainingDay empty The calendar entry spans the rest of the day.
VacationCreditUntilNextRecurrence empty A vacation credit.
TimeFrame From - To with the format HH:MM - HH:MM The calendar entry has a start and end, e.g. 10:00 - 12:00

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/planning/calendarEntries' \ --header 'Authorization: Bearer {{token}}' \ --header 'Content-Type: application/json' \ --data '{ "employeeIds": [ "26A55C32-B680-42F6-821E-5433B6122C3C" ], "from": "2024-01-01", "to": "2024-07-31", "language": "de" }'

Example Response

[ { "employeeId": "26a55c32-b680-42f6-821e-5433b6122c3c", "employeeName": "value value", "employeeCalendar": [ { "from": "2024-07-01", "to": "2024-07-01", "timeType": "d6b477a3-90df-4977-b9b0-9378d04d67eb", "timeTypeLabel": "?", "timeFrame": "WholeDay", "timeFrameAdditionalData": "", "label": "" } ], "organisationCalendars": [ { "calendarId": "7c7bd14c-23a5-4dd0-b990-65824a9990fd", "name": "Betrieb", "calendarEntries": [ { "from": "2024-04-01", "to": "2024-04-01", "timeType": "8ed4cf38-6b07-41ad-ba67-e422711d96b9", "timeTypeLabel": "Feiertag", "timeFrame": "WholeDay", "timeFrameAdditionalData": "", "label": "Ostermontag" }, { "from": "2024-05-09", "to": "2024-05-09", "timeType": "8ed4cf38-6b07-41ad-ba67-e422711d96b9", "timeTypeLabel": "Feiertag", "timeFrame": "WholeDay", "timeFrameAdditionalData": "", "label": "Auffahrt" }, { "from": "2024-05-20", "to": "2024-05-20", "timeType": "8ed4cf38-6b07-41ad-ba67-e422711d96b9", "timeTypeLabel": "Feiertag", "timeFrame": "WholeDay", "timeFrameAdditionalData": "", "label": "Pfingstmontag" }, { "from": "2024-05-30", "to": "2024-05-30", "timeType": "8ed4cf38-6b07-41ad-ba67-e422711d96b9", "timeTypeLabel": "Feiertag", "timeFrame": "WholeDay", "timeFrameAdditionalData": "", "label": "Fronleichnam" } ] } ] } ]

Undertakings

Undertakings are used to track time spent on activities (e.g. project time tracking).

A structure defines the form how time is tracked. A structure must first be created in TimeRocket before the API can be used. Structures cannot be created over the API.

An undertaking represents a single project, facility or thing-that-is-tracked. An undertaking contains a set of actions to which time can be allocated by creating an activity.

An activity contains who did what on which day.

Undertakings can be grouped by undertaking groups. A hierarchy of groups is specified by using several levels.

Permission definitions provide a way to specify a set of common permissions to be reused in undertakings.

Get Structures

https://api.timerocket.ch/public/v1.0/undertakings/structures

Queries all undertaking structures. A structure defines actions and levels that are used by undertakings.

The actions defined by a structure can be shared by its undertakings. In addition, undertakings can have their own specific actions. However, undertaking specific actions can not be aggregated over several undertakings.

Response

Field Type Description
structureId GUID The ID of the structure.
label JSON object literal The label defines how the structure should be presented to users.
label.default string The default label. The fallback if no translation is present for a specific language.
label.de OPTIONAL FIELD
string
German translation.
label.en OPTIONAL FIELD
string
English translation.
label.fr OPTIONAL FIELD
string
French translation.
label.it OPTIONAL FIELD
string
Italian translation.

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/undertakings/structures'

Example Response

[ { "structureId": "2E572CF9-7A7B-4FEA-8755-477413ADF047", "label": { "default": "Projekterfassung" } } ]

Get Structure

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}

Gets a single undertaking structure.

A structure defines the form of its contained undertakings (levels, structure actions, permission definitions etc.).

Request

structureId: ID of the structure requested.

Response

Field Type Description
structureId GUID The ID of the structure.
label JSON object literal The label defines how the structure should be presented to users.
label.default string The default label. The fallback if no translation is present for a specific language.
label.de OPTIONAL FIELD
string
German translation.
label.en OPTIONAL FIELD
string
English translation.
label.fr OPTIONAL FIELD
string
French translation.
label.it OPTIONAL FIELD
string
Italian translation.
actions array All actions defined by this structure.
actions[].actionId GUID The ID of the action.
actions[].label JSON object literal The label of the action.
actions[].label.default / .de / .en / .fr / .it string / OPTIONAL FIELDS
string
The default and, optionally, the translations.
actions[].code OPTIONAL FIELD
string
The code of the action. Only available for structures with enabled codes. It may be empty if the action has no code.
levels array The ordered list of levels. Levels are used to group undertakings. Typical levels are "customers", "orders".
levels[].levelId GUID The ID of the level.
levels[].singularLabel JSON object literal The singular label (e.g. "Customer" or "Order") used for this level.
levels[].singularLabel.default / .de / .en / .fr / .it string / OPTIONAL FIELDS
string
The default and, optionally, the translations.
levels[].pluralLabel JSON object literal The plural label (e.g. "Customers" or "Orders") used for this level.
levels[].pluralLabel.default / .de / .en / .fr / .it string / OPTIONAL FIELDS
string
The default and, optionally, the translations.
codes string Either with or without. With: structure uses codes to identify undertakings, actions, and multi-actions. Without: no codes are available.

Example Request

curl --location -g 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}'

Example Response

{ "structureId": "2E572CF9-7A7B-4FEA-8755-477413ADF047", "label": { "default": "Projekterfassung" }, "actions": [ { "actionId": "5FC75C68-5C17-4343-813C-6DD4081B76E0", "label": { "default": "Planen" } }, { "actionId": "527CD747-9486-46AE-A54E-6BCB50947E0E", "label": { "default": "Zuschneiden" } }, { "actionId": "53628746-42A8-41EF-9384-30385823D461", "label": { "default": "Assemblieren" } }, { "actionId": "4BF4FACE-630E-49B6-87C5-2D51F76F1A0F", "label": { "default": "Liefern" } }, { "actionId": "EA58B13C-71CB-45DB-A776-D1F80BFE5509", "label": { "default": "Montieren" } } ], "levels": [ { "levelId": "B232A872-1CAB-461F-9CEF-94CD1DF77C27", "singularLabel": { "default": "Kunde" }, "pluralLabel": { "default": "Kunden" } }, { "levelId": "D5DFCAA8-BA45-467A-8804-782A1136839D", "singularLabel": { "default": "Auftrag" }, "pluralLabel": { "default": "Aufträge" } } ], "codes": "without" }

Get Groups

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/groups

Gets the (active/non-archived) undertaking groups of a structure.

Request

structureId: ID of the structure to get the groups of.

Response

Field Type Description
undertakingGroupId GUID ID of the group.
label JSON object literal The label defines how the group should be presented to users.
label.default string The default label. The fallback if no translation is present for a specific language.
label.de OPTIONAL FIELD
string
German translation.
label.en OPTIONAL FIELD
string
English translation.
label.fr OPTIONAL FIELD
string
French translation.
label.it OPTIONAL FIELD
string
Italian translation.
levelId GUID The level this group belongs to in the structure.

Example Request

curl --location -g 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/groups'

Example Response

[ { "undertakingGroupId": "97516FCD-2C3B-4981-8880-214BB8349007", "label": { "default": "Gartenlaube Meier" }, "levelId": "125354D9-3CFE-48CA-A551-9F7456542F9C" }, { "undertakingGroupId": "45BD22F8-3931-4CE4-98DC-35EA1EAA59A3", "label": { "default": "Meier" }, "levelId": "39F8D028-FB40-4087-BE21-3173AFF2E69F" } ]

Get Permission Definitions

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/permissionDefinitions

Gets the permission definitions of a structure.

Permission definitions can be used to authorize persons to write or read activities. In addition, permissions can be granted on individual undertakings.

Request

structureId: ID of the structure to get the groups of.

Response

Field Type Description
permissionDefinitionId GUID The ID of the
label JSON object literal The label defines how the permission definition should be presented to users.
label.default string The default label. The fallback if no translation is present for a specific language.
label.de OPTIONAL FIELD
string
German translation
label.en OPTIONAL FIELD
string
English translation
label.fr OPTIONAL FIELD
string
French translation
label.it OPTIONAL FIELD
string
Italian translation
target string Eitherallorspecific.
all: The permission definition applies to all employees.
specific: The fieldpersonsspecifies the persons to whom this permission definition applies.
persons OPTIONAL FIELD
string array
The list of persons (names) to which this permission definition applies. Only available iftarget=specific.

Example Request

curl --location -g 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/permissionDefinitions'

Example Response

[ { "permissionDefinitionId": "CC76473B-EB93-4E65-9E24-E1C44BDCF316", "label": { "default": "Lesen für HR und GF erlaubt" }, "target": "specific", "persons": [ "Fülling Gerhard", "Lüthi Hansruedi" ] }, { "permissionDefinitionId": "A0AFA1CF-75A9-406E-BD74-FB5942159378", "label": { "default": "Schreiben für alle erlaubt" }, "target": "all" } ]

Update Undertaking Group

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/groups/{groupId}

Updates an undertaking group.

Request

Field Type Description
label OPTIONAL FIELD
JSON object literal
If specified, the label of the undertaking is updated.
label.default string The default label. The fallback if no translation is present for a specific language.
label.de OPTIONAL FIELD
string
German translation
label.en OPTIONAL FIELD
string
English translation
label.fr OPTIONAL FIELD
string
French translation
label.it OPTIONAL FIELD
string
Italian translation

Example Request

curl --location -g --request PUT 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/groups/{groupId}' \ --header 'Content-Type: application/json' \ --data '{ "label": { "default": "Meier und Söhne" } }'

Example Response

No response body

Create Undertaking

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings

Creates an undertaking.

Request

structureId: ID of the structure

Field Type Description
label JSON object literal The label defines how the undertaking should be presented to users.
label.default string The default label. The fallback if no translation is present for a specific language.
label.de OPTIONAL FIELD
string
German translation
label.en OPTIONAL FIELD
string
English translation
label.fr OPTIONAL FIELD
string
French translation
label.it OPTIONAL FIELD
string
Italian translation
actions array of JSON object literal The actions (structure or undertaking-specific) available in this undertaking. The order defines the order shown on the UI.
actions[].kind string Either "structure" for structure actions (already defined in the structure) or "undertaking" (undertaking-specific). Undertaking-specific actions are not available to other undertakings.
actions[].structureActionId OPTIONAL FIELD
GUID
The ID of the structure action.
Only valid when kind =structure
actions[].undertakingAction OPTIONAL FIELD
JSON object literal
The undertaking-specific action.
Only valid when kind =undertaking
actions[].undertakingAction.Label JSON object literal The label defines how the undertaking-specific action should be presented to users.
actions[].undertakingAction.code OPTIONAL FIELD
string
The code of the undertaking-specific action.
Only available if the structure has codes enabled.
undertakingSpecificActions[].Label.default / .de / .en / .fr / .it string The default (required) and translations (optional).
groups array of GUID The groups this undertaking belongs to.
Must be in the order of the levels given by the structure.
status OPTIONAL FIELD
string
"running"or"planned".
If omitted,"running"is used.

Other status are currently not supported by the API.
bookableRange OPTIONAL FIELD
string
The range defining when activities can be booked onto this undertaking.
"yyyy-MM-dd/yyyy-MM-dd": a range with start and end (from - until)
"yyyy-MM-dd/": a range with only a start and no end (from)
"/yyyy-MM-dd": a range with no start and only an end (until)
finishedActionsSettings OPTIONAL FIELD
string
"all": all employees can mark actions as finished.
"specific": only the persons specified by the field"employeesWhoCanFinishActions"can finish actions
omitted: undertaking does not support finishing actions
employeesWhoCanFinishActions OPTIONAL FIELD
array of GUID
Only applicable when"finishedActionsSettings"="specific".
The employees' IDs who can mark actions as finished.
permissionDefinitionIds OPTIONAL FIELD
array of GUID
The permission definitions to use for this undertaking.
managers array of GUID The employees' IDs who act as managers of this undertaking (e.g. project lead).
code OPTIONAL FIELD
string
The code of this undertaking.
Ignored, if the structure does not support codes.

Response

The ID of the newly created undertaking.

Example Request

curl --location -g 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings' \ --header 'Content-Type: application/json' \ --data '{ "structureId": "2E572CF9-7A7B-4FEA-8755-477413ADF047", "label": { "default": "Project", "de": "Projekt" }, "actions": [ { "kind": "structure", "structureActionId": "DC0596FC-5BCC-483E-A439-E8AD73C0F808" }, { "kind": "undertaking", "undertakingAction": { "label": { "default": "Lasern" } } }, { "kind": "structure", "structureActionId": "02027195-682F-4A53-85EF-0B11D7E74D9D" } ], "structureActions": [ "DC0596FC-5BCC-483E-A439-E8AD73C0F808", "02027195-682F-4A53-85EF-0B11D7E74D9D" ], "groups": [ "45BD22F8-3931-4CE4-98DC-35EA1EAA59A3", "97516FCD-2C3B-4981-8880-214BB8349007" ], "status": "running", "bookableRange": "2024-01-01/2025-12-31", "permissionDefinitionIds": [ "CC76473B-EB93-4E65-9E24-E1C44BDCF316" ], "undertakingSpecificPermissions": [ { "actions": [ "DC0596FC-5BCC-483E-A439-E8AD73C0F808" ], "permissionKind": "read", "employees": [ "47e5cab9-758c-4278-a828-8038891d2517", "65115d26-ee20-49a2-8863-c313ed3cb895" ] } ], "managers": [ "47e5cab9-758c-4278-a828-8038891d2517" ] }'

Example Response

"8370c7e0-7cdc-4593-90c8-c3c31eb33bbe"

Get Undertaking

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}

Gets an undertaking.

Request

structureId: ID of the structure

undertakingId: ID of the undertaking

Response

Field Type Description
undertakingId GUID The ID of the undertaking.
label JSON object literal The label of the undertaking
label.default string The default label. The fallback if no translation is present for a specific language.
label.de OPTIONAL FIELD
string
German translation
label.en OPTIONAL FIELD
string
English translation
label.fr OPTIONAL FIELD
string
French translation
label.it OPTIONAL FIELD
string
Italian translation
groups array of JSON object literal The labels of the groups to which this undertaking is assigned.
groups[].default string The default label. The fallback if no translation is present for a specific language.
groups[].de OPTIONAL FIELD
string
German translation
groups[].en OPTIONAL FIELD
string
English translation
groups[].fr OPTIONAL FIELD
string
French translation
groups[].it OPTIONAL FIELD
string
Italian translation
status string One of
- planned
- running
- finished
- archived
bookableRange string The range defining when activities can be booked onto this undertaking.
"yyyy-MM-dd/yyyy-MM-dd": a range with start and end (from - until)
"yyyy-MM-dd/": a range with only a start and no end (from)
"/yyyy-MM-dd": a range with no start and only an end (until)
code string The code of the undertaking. Empty if none.
actions array of JSON object literal The actions of the undertaking.
actions[].kind string The kind of the action:
-"structure": the action is defined on the structure
-"undertaking": it's an undertaking-specific action
actions[].action JSON object literal The action.
actions[].action.actionId GUID The action's ID.
actions[].action.label JSON object literal The label of the action
actions[].action.label.default string The default label. The fallback if no translation is present for a specific language.
actions[].action.label.de OPTIONAL FIELD
string
German translation
actions[].action.label.en OPTIONAL FIELD
string
English translation
actions[].action.label.fr OPTIONAL FIELD
string
French translation
actions[].action.label.it OPTIONAL FIELD
string
Italian translation

Example Request

curl --location -g 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}' \ --header 'Content-Type: application/json'

Example Response

{ "undertakingId": "5475f020-2c2d-406e-840c-c021f1a978b0", "label": { "default": "Project", "de": "Projekt" }, "groups": [ { "default": "Meier" }, { "default": "Gartenlaube Meier" } ], "status": "running", "bookableRange": "2024-01-01/2025-12-31", "code": "1234", "actions": [ { "kind": "structure", "action": { "actionId": "C1215DC0-DD00-46A6-9F3A-95AE88414641", "label": { "default": "Planen" } } }, { "kind": "structure", "action": { "actionId": "064FACE7-301A-4539-A503-857CE18CB586", "label": { "default": "Zuschneiden" } } }, { "kind": "project", "action": { "actionId": "918AEAC7-B42B-43AF-98AA-D64263F503BB", "label": { "default": "Lasern" } } } ], "finishedActions": [ "064FACE7-301A-4539-A503-857CE18CB586" ] }

Update Undertaking

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}

Updates an undertaking.

Request

structureId: ID of the structure with the undertaking to update.

undertakingId: ID of the undertaking to update.

Field Type Description
label OPTIONAL FIELD
JSON object literal
If specified, the label of the undertaking is updated.
label.default string The default label. The fallback if no translation is present for a specific language.
label.de OPTIONAL FIELD
string
German translation
label.en OPTIONAL FIELD
string
English translation
label.fr OPTIONAL FIELD
string
French translation
label.it OPTIONAL FIELD
string
Italian translation
code OPTIONAL FIELD
string
If specified, the code of the undertaking is updated.
Ignored, if the structure does not support codes.
groups GUID array The Group IDs to assign to the undertaking. Needs an ID per level pointing to a group of the corresponding level.
Pass "" (empty string) when a level has no assigned group (level settings must be set accordingly).
bookableRange OPTIONAL FIELD
string
If specified, the bookable range is updated.
"yyyy-MM-dd/yyyy-MM-dd": a range with start and end (from - until)
"yyyy-MM-dd/": a range with only a start and no end (from)
"/yyyy-MM-dd": a range with no start and only an end (until)
status OPTIONAL FIELD
string
One of
-"planned"
-"running"
-"finished": fieldfinishermust be specified, too
-"archived": fieldarchivermust be specified, too
managers OPTIONAL FIELD
GUID array
The employees' IDs who act as managers of this undertaking (e.g. project lead).
NOT YET AVAILABLE
finisher
OPTIONAL FIELD
string
Must be specified when status = "finished".
The ID of the employee who finished the undertaking.
NOT YET AVAILABLE
archiver
OPTIONAL FIELD
string
Must be specified when status = "archived".
The ID of the employee who archived the undertaking.

Example Request

curl --location -g --request PUT 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}' \ --header 'Content-Type: application/json' \ --data '{ "label": { "default": "Renamed" } }'

Example Response

No response body

Add Undertaking Specific Permission

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/undertakingSpecificPermissions

Adds an undertaking-specific permission to an undertaking.

Request

structureId: ID of the structure

undertakingId: ID of the undertaking

Field Type Description
actions OPTIONAL FIELD
array of GUID
The actions' IDs to include in the permission (structure and undertaking specific actions possible)
If omitted, the permission targets the whole undertaking (all actions).
permissionKind string "read"or"write"
employees array of GUID The employees' IDs to whom this permission applies.

Response

The ID of the newly added undertaking-specific permission.

Example Request

curl --location -g 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/undertakingSpecificPermissions' \ --header 'Content-Type: application/json' \ --data '{ "actions": [ "DC0596FC-5BCC-483E-A439-E8AD73C0F808" ], "permissionKind": "read", "employees": [ "47e5cab9-758c-4278-a828-8038891d2517", "65115d26-ee20-49a2-8863-c313ed3cb895" ] }'

Example Response

"8370c7e0-7cdc-4593-90c8-c3c31eb33bbe"

Update Undertaking Specific Permission

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/undertakingSpecificPermissions/{undertakingSpecificPermissionId}

Updates an undertaking-specific permission of an undertaking.

Request

structureId: ID of the structure

undertakingId: ID of the undertaking

undertakingSpecificPermissionId: ID of the undertaking-specific permission

Field Type Description
actions OPTIONAL FIELD
array of GUID
The actions' IDs to include in the permission (structure and undertaking specific actions possible)
If omitted, the permission targets the whole undertaking (all actions).
permissionKind string "read"or"write"
employees array of GUID The employees' IDs to whom this permission applies.

Response

No content.

Example Request

curl --location -g --request PUT 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/undertakingSpecificPermissions/{undertakingSpecificPermission}' \ --header 'Content-Type: application/json' \ --data '{ "actions": [ "DC0596FC-5BCC-483E-A439-E8AD73C0F808" ], "permissionKind": "read", "employees": [ "47e5cab9-758c-4278-a828-8038891d2517", "65115d26-ee20-49a2-8863-c313ed3cb895" ] }'

Example Response

No response body

Remove Undertaking Specific Permission

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/undertakingSpecificPermissions/{undertakingSpecificPermissionId}

Removes an undertaking-specific permission from an undertaking.

Request

structureId: ID of the structure

undertakingId: ID of the undertaking

undertakingSpecificPermissionId: ID of the undertaking-specific permission

Response

No content.

Example Request

curl --location -g --request DELETE 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/undertakingSpecificPermissions/{undertakingSpecificPermissionId}' \ --header 'Content-Type: application/json'

Example Response

No response body

Get Undertaking Specific Permissions

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/undertakingSpecificPermissions

Get the undertaking-specific permissions of an undertaking.

Request

structureId: ID of the structure

undertakingId: ID of the undertaking

Response

Field Type Description
undertakingSpecificPermissionId GUID The ID of the undertaking-specific permission.
permissionKind string "read"or"write"
employeeIds Array of GUID The IDs of the employees this permission applies to.

Example Request

curl --location -g 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/undertakingSpecificPermissions' \ --header 'Content-Type: application/json'

Example Response

[ { "undertakingSpecificPermissionId": "2ED4D7BB-5469-4E78-98D2-D7D275A253C0", "permissionKind": "write", "employeeIds": [ "47E5CAB9-758C-4278-A828-8038891D2517" ] } ]

Create Manual Activity

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/activities/manual

Creates a new manual activity.

Request

structureId: ID of the structure with the undertaking to update.

undertakingId: ID of the undertaking to update.

Field Type Description
employeeId GUID The employee's ID.
actionId GUID The action's ID.
workday yyyy-MM-dd The date when the activity happenend.
This is the date the activity belongs to regarding accounting. It may differ from the calendar date when working over midnight.
duration OPTIONAL FIELD
number
The duration of the activity.
Either specifydurationorfromandto.
from OPTIONAL FIELD
hh:mm / hh:mm-shift / hh:mmshift
When the activity started.
Either specifydurationorfromandto.

The format is one of:
hh:mm: local time (e.g. 10:30)
hh:mm-shift: local time and a negative day shift (e.g. 23:00-1 = 23:00 on the day before theworkday)
hh:mmshift: local time and a (positive) day shift (e.g. 01:001 = 01:00 on the day after theworkday)
to OPTIONAL FIELD
hh:mm / hh:mm-shift / hh:mmshift
When the activity stopped.
Either specifydurationorfromandto.

The format is one of:
hh:mm: local time (e.g. 10:30)
hh:mm-shift: local time and a negative day shift (e.g. 23:00-1 = 23:00 on the day before theworkday)
hh:mmshift: local time and a (positive) day shift (e.g. 01:001 = 01:00 on the day after theworkday)
description OPTIONAL FIELD
string
An optional description.

Response

The ID of the newly created manual activity.

Example Request

curl --location -g 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/activities/manual' \ --header 'Content-Type: application/json' \ --data '{ "employeeId": "47e5cab9-758c-4278-a828-8038891d2517", "workday": "2024-12-03", "actionId": "DC0596FC-5BCC-483E-A439-E8AD73C0F808", "duration": 60 }'

Example Response

"22A2FE34-A35B-4CD8-A965-8103BB4CAAA9"

Query Activities

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/activities?employeeIds={emloyeeIds}&start={start}&end={end}&groups={groupIds}

Query activities.

The result contains

  • manual activities: activities enter manually or via the API as manual activities,
  • activities generated from attendance by setting a default action,
  • multi action activities,
  • multi action activities generated from attendance.

Request

structureId: ID of the structure with the undertaking to update.

URL Paramter Type Description
employeeIds OPTIONAL
semicolon-delimited list of GUIDs
The employees' IDs to get the activities for.
If omitted, the activities of all employees are returned.
groups OPTIONAL
comma-delimited list of GUIDs
Only activities of undertakings in the specified groups are returned.
Activities from all undertakings are returned if omitted.
start yyyy-MM-dd Only activities betweenstartandendare returned. Including boundaries.
end yyyy-MM-dd Only activities betweenstartandendare returned. Including boundaries.
undertakingStatus OPTIONAL
string
One of:
"running": only running undertakings are considered
"plannedRunningFinished": undertakings that are either planned, running, or finished are considered (archived is excluded)
"all": all undertakings are considered

If omitted,"running"is used.

Response

Field Type Description
kind string One of:
-"manual activity"
-"multi action activity instance"
-"activity from attendance"
-"multi action activity instance from attendance"
activityId OPTIONAL FIELD
GUID
The ID of the activity.
Depending on the type of activity, this is a stable ID (manual activity) or a non-stable ID (other kinds).
multiActionId OPTIONAL FIELD
GUID
The ID of the multi action.
Only available whenkindis"multi action activity instance"or"multi action activity instance from attendance".
employeeId string The employee's ID.
workday yyyy-MM-dd The date this activity belongs to.
undertakingId GUID The undertaking's ID.
actionId GUID The action's ID.
from OPTIONAL FIELD
hh:mm / hh:mm-shift / hh::mmshift
When the activity started.
Only available for activities with start/end information.

The format is one of:
hh:mm: local time (e.g. 10:30)
hh:mm-shift: local time and a negative day shift (e.g. 23:00-1 = 23:00 on the day before the workday)
hh:mmshift: local time and a (positive) day shift (e.g. 01:001 = 01:00 on the day after the workday)
to OPTIONAL FIELD
hh:mm / hh:mm-shift / hh::mmshift
When the activity ended.
Only available for activities with start/end information.

The format is one of:
hh:mm: local time (e.g. 10:30)
hh:mm-shift: local time and a negative day shift (e.g. 23:00-1 = 23:00 on the day before the workday)
hh:mmshift: local time and a (positive) day shift (e.g. 01:001 = 01:00 on the day after the workday)
duration number The duration of the activity.
Use this number for calculations.
Caution: It can be a decimal number. E.g. when 17 minutes is distributed to two activities of a single multi action, resulting in twice 8.5 minutes.
sharedFrom OPTIONAL FIELD
hh:mm / hh:mm-shift / hh::mmshift
Only available for multi action activities and multi action activities from attendance.
The start of the shared timeframe.

The format is one of:
hh:mm: local time (e.g. 10:30)
hh:mm-shift: local time and a negative day shift (e.g. 23:00-1 = 23:00 on the day before the workday)
hh:mmshift: local time and a (positive) day shift (e.g. 01:001 = 01:00 on the day after the workday)
sharedTo OPTIONAL FIELD
hh:mm / hh:mm-shift / hh::mmshift
Only available for multi action activities and multi action activities from attendance.
The end of the shared timeframe.

The format is one of:
hh:mm: local time (e.g. 10:30)
hh:mm-shift: local time and a negative day shift (e.g. 23:00-1 = 23:00 on the day before the workday)
hh:mmshift: local time and a (positive) day shift (e.g. 01:001 = 01:00 on the day after the workday)
sharedDuration OPTIONAL FIELD
number
Only available for multi action activities and multi action activities from attendance.
The duration of the shared timeframe.
description string The description.
action JSON object literal The label of the action.
action.default string The default label. The fallback if no translation is present for a specific language.
action.de OPTIONAL FIELD
string
German translation
action.en OPTIONAL FIELD
string
English translation
action.fr OPTIONAL FIELD
string
French translation
action.it OPTIONAL FIELD
string
Italian translation
undertaking JSON object literal The label of the undertaking.
undertaking.default string The default label. The fallback if no translation is present for a specific language.
undertaking.de OPTIONAL FIELD
string
German translation
undertaking.en OPTIONAL FIELD
string
English translation
undertaking.fr OPTIONAL FIELD
string
French translation
undertaking.it OPTIONAL FIELD
string
groups array of JSON object literal The labels of the groups the undertaking belongs to. The order is according to the levels of the structure.
groups[].default string The default label. The fallback if no translation is present for a specific language.
groups[].de OPTIONAL FIELD
string
German translation
groups[].en OPTIONAL FIELD
string
English translation
groups[].fr OPTIONAL FIELD
string
French translation
groups[].it OPTIONAL FIELD
string
Italian translation

Params

employeeIds {emloyeeIds}
start {start}
end {end}
groups {groupIds}

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/undertakings/structures/70029389-349F-43B9-B4AD-BE5F55863EDF/activities?employeeIds=47e5cab9-758c-4278-a828-8038891d2517&start=2024-12-01&end=2024-12-31&groups=97516FCD-2C3B-4981-8880-214BB8349007' \ --header 'Content-Type: application/json'

Example Response

[ { "kind": "manual activity", "activityId": "FADBA549-B340-4A9E-9BEC-F736DE338775", "employeeId": "47E5CAB9-758C-4278-A828-8038891D2517", "workday": "2024-12-03", "undertakingId": "8370C7E0-7CDC-4593-90C8-C3C31EB33BBE", "actionId": "DC0596FC-5BCC-483E-A439-E8AD73C0F808", "duration": 60, "description": "", "action": { "default": "Planen" }, "undertaking": { "default": "Project", "de": "Projekt" }, "groups": [ { "default": "Meier" }, { "default": "Gartenlaube Meier" } ] }, { "kind": "manual activity", "activityId": "953045DD-4D1A-43F2-84FE-85D740A7EB70", "employeeId": "47E5CAB9-758C-4278-A828-8038891D2517", "workday": "2024-12-09", "undertakingId": "6BE68BF9-4980-4540-841C-7CA05BBAAB2D", "actionId": "DC0596FC-5BCC-483E-A439-E8AD73C0F808", "from": "13:00", "to": "17:00", "duration": 240, "description": "", "action": { "default": "Planen" }, "undertaking": { "default": "Wasseranschluss" }, "groups": [ { "default": "Meier" }, { "default": "Gartenlaube Meier" } ] }, { "kind": "manual activity", "activityId": "80283C4C-82D3-435C-BF56-F723808F7E26", "employeeId": "47E5CAB9-758C-4278-A828-8038891D2517", "workday": "2024-12-09", "undertakingId": "C6833007-A205-4430-9400-59580A399C82", "actionId": "DC0596FC-5BCC-483E-A439-E8AD73C0F808", "from": "08:00", "to": "12:00", "duration": 240, "description": "Schwierige Planung", "action": { "default": "Planen" }, "undertaking": { "default": "Gartenlaube" }, "groups": [ { "default": "Meier" }, { "default": "Gartenlaube Meier" } ] } ]

Query Undertakings

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings?status={status}

Query undertakings of a structure by their status.

Request

structureId: The ID of the structure to be queried.

URL parameter Type Description
status OPTIONAL
string
One of:
-planned: return planned undertakings
-running: return running undertakings
-finished: return finished undertakings
-archived: return archived undertakings
-all: return all undertakings

If omitted,runningis used.

Response

Field Type Description
undertakingId GUID The ID of the undertaking.
label JSON object literal The label of the undertaking
label.default string The default label. The fallback if no translation is present for a specific language.
label.de OPTIONAL FIELD
string
German translation
label.en OPTIONAL FIELD
string
English translation
label.fr OPTIONAL FIELD
string
French translation
label.it OPTIONAL FIELD
string
Italian translation
groups array of JSON object literal The labels of the groups to which this undertaking is assigned.
groups[].default string The default label. The fallback if no translation is present for a specific language.
groups[].de OPTIONAL FIELD
string
German translation
groups[].en OPTIONAL FIELD
string
English translation
groups[].fr OPTIONAL FIELD
string
French translation
groups[].it OPTIONAL FIELD
string
Italian translation
status string One of
- planned
- running
- finished
- archived
bookableRange string The range defining when activities can be booked onto this undertaking.
"yyyy-MM-dd/yyyy-MM-dd": a range with start and end (from - until)
"yyyy-MM-dd/": a range with only a start and no end (from)
"/yyyy-MM-dd": a range with no start and only an end (until)
code string The code of the undertaking. Empty if none.
actions array of JSON object literal The actions of the undertaking.
actions[].kind string The kind of the action:
-"structure": the action is defined on the structure
-"undertaking": it's an undertaking-specific action
actions[].action JSON object literal The action.
actions[].action.actionId GUID The action's ID.
actions[].action.label JSON object literal The label of the action
actions[].action.label.default string The default label. The fallback if no translation is present for a specific language.
actions[].action.label.de OPTIONAL FIELD
string
German translation
actions[].action.label.en OPTIONAL FIELD
string
English translation
actions[].action.label.fr OPTIONAL FIELD
string
French translation
actions[].action.label.it OPTIONAL FIELD
string
Italian translation

Params

status {status}

Example Request

curl --location -g 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings?status=running' \ --header 'Content-Type: application/json'

Example Response

[ { "undertakingId": "02e76b25-eb6b-40bd-9bc9-211cfdebc7e0", "label": { "default": "Gartenlaube" }, "groups": [ { "default": "Meier" }, { "default": "Gartenlaube Meier" } ], "status": "running", "bookableRange": "eternity", "code": "" }, { "undertakingId": "92bacec1-c6db-4c0b-b225-b7bef718f111", "label": { "default": "Wasseranschluss" }, "groups": [ { "default": "Meier" }, { "default": "Gartenlaube Meier" } ], "status": "running", "bookableRange": "eternity", "code": "" } ]

Create Budget

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/budgets

Request

structureId: ID of the structure in which the budget should be created.

Field Type Description
source OPTIONAL FIELD
JSON object literal
Specifies what the budget accumulates.
Either specifysourceorsourcesandlabel.
source.undertakingId GUID The ID of the undertaking (e.g. project).
source.actionId OPTIONAL FIELD
GUID
If specified, the budget only accumulates the durations of activities of this action in the specified undertaking. Otherwise, all actions of the undertaking are accumulated.
sources OPTIONAL FIELD
JSON object literal array
Used to accumulate durations from different projects or actions (within projects).
Either specifysourceorsourcesandlabel.

The elements of the array follow the definition of the singlesourceabove.

Use this to specify a budget that accumulates durations of activities from several undertakings, and or actions.
label OPTIONAL FIELD
JSON object literal
Specifies the name of the label. Only valid when creating a budget with multiple sources.
Either specifysourceorsourcesandlabel.
bookingRecurrencePattern JSON object literal The recurrence pattern for the budget booking. The budget booking can either be once or a fixed set of dates. More options are available through the TimeRocket UI.
bookingRecurrencePattern.once OPTIONAL FIELD
string in the formatyyyy-MM-dd
The date for the single budget booking.
Eitherspecifyonce orfixDates.
bookingRecurrencePattern.fixDates OPTIONAL FIELD
array of strings in the formatyyyy-MM-dd
The dates for the recurring budget bookings.
Eitherspecifyonce orfixDates.
bookingAmount number The amount of the budget in minutes (a non-negative whole number).
bookingKind string Either
-"absolute": the budget (re)starts at the booking date and no prior activtiies are considered; or
-"additive": the amount is added to a prior amount and prior activities are considered.

Response

The GUID of the created budget.

Example Request

curl --location -g 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/budgets' \ --header 'Content-Type: application/json' \ --data '{ "source": { "undertakingId": "ab5115b3-0854-4482-a42d-799b187c0a3b" }, "bookingRecurrencePattern": { "Once": "2025-01-01" }, "bookingAmount": 1000, "bookingKind": "Additive" }'

Example Response

"5bf1d912-81de-4ad9-9a51-dc2cdc8a0fd2"

Add Budget Booking

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/budgets/{budgetId}/bookings

Request

structureId: ID of the structure in which the budget exists.

budgetId: ID of the budget to add a booking to.

Field Type Description
recurrencePattern JSON object literal The recurrence pattern for the budget booking. The budget booking can either be once or a fixed set of dates. More options are available through the TimeRocket UI.
recurrencePattern.once OPTIONAL FIELD
string in the formatyyyy-MM-dd
The date for the single budget booking.
Eitherspecifyonce orfixDates.
recurrencePattern.fixDates OPTIONAL FIELD
array of strings in the formatyyyy-MM-dd
The dates for the recurring budget bookings.
Eitherspecifyonce orfixDates.
amount number The amount of the budget in minutes (a non-negative whole number).
kind string Either
-"absolute": the budget (re)starts at the booking date and no prior activtiies are considered; or
-"additive": the amount is added to a prior amount and prior activities are considered.

Response

The GUID of the created budget booking.

Example Request

curl --location -g 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/budgets/{budgetId}/bookings' \ --header 'Content-Type: application/json' \ --data '{ "recurrencePattern": { "Once": "2025-02-01" }, "amount": 200, "kind": "Additive" }'

Example Response

7c3c5af6-4641-4fc4-912b-751827482d47

Finish Action

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/finishedActions/{actionId}

Marks an action on an undertaking as finished.

This is only available when the undertaking supports finished actions (see undertaking's settings).

Request

structureId: ID of the structure

undertakingId: ID of the undertaking

actionId: ID of the action

Example Request

curl --location -g --request PUT 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/finishedActions/{actionId}'

Example Response

No response body

Restart Finished Action

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/finishedActions/{actionId}

Marks an action on an undertaking as not finished anymore.

This is only available when the undertaking supports finished actions (see undertaking's settings).

Request

structureId: ID of the structure

undertakingId: ID of the undertaking

actionId: ID of the action

Example Request

curl --location -g --request DELETE 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/finishedActions/{actionId}'

Example Response

No response body

Add Activity Booking

https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/actions/{actionId}/activityBookings

Adds an activity booking to an undertaking.

Request

structureId: ID of the structure

undertakingId: ID of the undertaking

actionId: ID of the action

Field Type Description
effective yyyy-MM-dd The effective date for the booking.
amount number The amount of the booking in minutes with decimals, e.g. 120.5 = 2 hours and 30 minutes.
employeeId OPTIONAL FIELD
GUID
The optional employee's ID to associate with this booking.

Response

The ID of the created booking.

Example Request

curl --location -g 'https://api.timerocket.ch/public/v1.0/undertakings/structures/{structureId}/undertakings/{undertakingId}/actions/{actionId}/activityBookings' \ --header 'Content-Type: application/json' \ --data '{ "effective": "2025-09-16", "amount": 120.5 }'

Example Response

"C1215DC0-DD00-46A6-9F3A-95AE88414641"

Remove Activity Booking

https://api.timerocket.ch/public/v1.0/undertakings/activityBookings/{activityBookingId}

Removes an activity booking from an undertaking.

Request

activityBookingId: ID of the activity booking

Example Request

curl --location -g --request DELETE 'https://api.timerocket.ch/public/v1.0/undertakings/activityBookings/{activityBookingId}'

Example Response

No response body

Query Activity Bookings

https://api.timerocket.ch/public/v1.0/undertakings/activityBookings?undertakingIds={undertakingIds}

Query activity bookings.

Request

URL Paramter Type Description
undertakingIds comma-delimited list of GUIDs The undertakings' IDs to get the activity bookings for.

Response

Field Type Description
activityBookingId GUID The ID of the activity booking.
effective yyyy-MM-dd The effective date of the activity booking.
undertakingId GUID The undertaking's ID.
actionId GUID The action's ID.
amount number The amount of the activity booking (can be positive or negative and contain decimal places).

Params

undertakingIds {undertakingIds}

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/undertakings/structures/70029389-349F-43B9-B4AD-BE5F55863EDF/activities?employeeIds=47e5cab9-758c-4278-a828-8038891d2517&start=2024-12-01&end=2024-12-31&groups=97516FCD-2C3B-4981-8880-214BB8349007' \ --header 'Content-Type: application/json' \ --data ''

Example Response

[ { "kind": "manual activity", "activityId": "FADBA549-B340-4A9E-9BEC-F736DE338775", "employeeId": "47E5CAB9-758C-4278-A828-8038891D2517", "workday": "2024-12-03", "undertakingId": "8370C7E0-7CDC-4593-90C8-C3C31EB33BBE", "actionId": "DC0596FC-5BCC-483E-A439-E8AD73C0F808", "duration": 60, "description": "", "action": { "default": "Planen" }, "undertaking": { "default": "Project", "de": "Projekt" }, "groups": [ { "default": "Meier" }, { "default": "Gartenlaube Meier" } ] }, { "kind": "manual activity", "activityId": "953045DD-4D1A-43F2-84FE-85D740A7EB70", "employeeId": "47E5CAB9-758C-4278-A828-8038891D2517", "workday": "2024-12-09", "undertakingId": "6BE68BF9-4980-4540-841C-7CA05BBAAB2D", "actionId": "DC0596FC-5BCC-483E-A439-E8AD73C0F808", "from": "13:00", "to": "17:00", "duration": 240, "description": "", "action": { "default": "Planen" }, "undertaking": { "default": "Wasseranschluss" }, "groups": [ { "default": "Meier" }, { "default": "Gartenlaube Meier" } ] }, { "kind": "manual activity", "activityId": "80283C4C-82D3-435C-BF56-F723808F7E26", "employeeId": "47E5CAB9-758C-4278-A828-8038891D2517", "workday": "2024-12-09", "undertakingId": "C6833007-A205-4430-9400-59580A399C82", "actionId": "DC0596FC-5BCC-483E-A439-E8AD73C0F808", "from": "08:00", "to": "12:00", "duration": 240, "description": "Schwierige Planung", "action": { "default": "Planen" }, "undertaking": { "default": "Gartenlaube" }, "groups": [ { "default": "Meier" }, { "default": "Gartenlaube Meier" } ] } ]

Unconfirmed

Query Salary Export

https://api.timerocket.ch/public/v1.0/salaryExport/export

The interface requires a correct configuration of the docks and a schedule for execution. Both define which wage export information is delivered.

Request

Field Type Description
executionDefinitionId GUID The TimeRocket ID of the execution definition.
from ISO 2014 date representation in the format yyyy-MM-dd Specifies the "from" date of the query range
to ISO 2014 date representation in the format yyyy-MM-dd Specifies the "to" date of the query range
bookingDate ISO 2014 date representation in the format yyyy-MM-dd Optional:
Specifies the "bookingDate" date of the bookingDate in the export

Response

Filestream in CSV Format (Semicolon)

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/salaryExport/export' \ --header 'Authorization: Bearer {{token}}' \ --header 'Content-Type: application/json' \ --data '{ "executionDefinitionId": "A7E5CAF9-758C-4278-A828-8038891D2517", "from": "2024-12-01", "to": "2024-12-31", "bookingDate": "2024-12-31" }'

Example Response

Filestream in CSV Format (Semicolon)

Activities

Add Item

https://api.timerocket.ch/public/v1.0/activityStructures/{activityStructureId}/{parentSetId}

Adds an item to an existing set. The set is identified by the ID of the activity structure and the ID of the set.

Set IDs are unique inside an activity structure.

An activity structure defines a hierarchy of items to model different ways of reporting activities.

Example structure:

  • Customers
    • Meier Treuhand
      • Activities
        • Concept
        • Realisation
    • Müller Bau AG
      • Activities
        • Design
        • Realisation

In the above example, Realisation occurs twice (same ID, same label). Therefore, reports sum activities for both into a single value (sum per item ID). If items are reused, the ID and label must match; otherwise a validation error is returned.

Structures can be freely defined. There are no fixed levels:

  • Customers
    • Meier Treuhand
      • Projects
        • New Attendance Time Tool
          • Activities
            • Concept
            • Roll-out
        • Security Alerts
          • Activities
            • Installation
    • Müller Bau AG
      • Objects
        • Headquarter
          • Todos
            • Concept
            • Working
        • Mountain hut

In the above example, sets with the same name need unique IDs. Sets always need unique IDs, and reports never aggregate over sets with the same name. Sets can share the same name without resulting in a validation error.

Every set and item can specify an activityBehavior that defines whether activities can be reported on items. If activityBehavior is omitted the item or set inherits the setting from its parent. When evaluating the behavior, TimeRocket starts with prohibited. So to enable reporting of activities, set the activityBehavior to permitted on the according item or set.

Field Type Description
id Guid, all uppercase
ID of the item. If the ID is reused in any structure, then these nodes represent all the same item. This can be used to create statistics and reports for nodes in several locations in multiple activity structures.
If IDs occur several times, the labels have to match; otherwise, a validation error is returned.
label JSON object literal Name of the item in different languages. Add a key/value pair per language with the key equal to the short language code ("de", "en", "fr", "it") and the value equal to the translation.
activityBehavior OPTIONAL FIELD: string, either "permitted" or "prohibited" If not specified the activity behavior of the parent set is inherited. If specified , the behavior is overridden.
set OPTIONAL FIELD: JSON object literal The set of items below this item.
set.id Guid, all uppercase ID of the set. Must be unique.
set.label JSON object literal The label of the set defines how the activity is displayed to the user.
set.label.key string
The key to identify the set.
Acts as a fallback in case there is no translation given for the queried language.
set.label.translations JSON object literal Name of the set in different languages. Add a key/value pair per language with the key equal to the short language code ("de", "en", "fr", "it") and the value equal to the translation.
set.activityBehavior OPTIONAL FIELD: string, either "permitted" or "prohibited" If not specified the activity behavior of the parent item is inherited. If specified , the behavior is overridden.
set.items JSON array The list of items in the set.

When defining an item, you can define its sub-set and therein contained items in a single request.

Response

If successful then the response is empty; otherwise the response contains a JSON object literal containing the error message.

Example Request

curl --location -g 'https://api.timerocket.ch/public/v1.0/activityStructures/{activityStructureId}/{parentSetId}' \ --header 'Content-Type: application/json' \ --data '{ "id": "CD7B0E39-20F4-4BD4-865B-F6D440FA98BB", "label": { "key": "Meier Treuhand" } }'

Example Request - with sub dimension

curl --location -g 'http://localhost:58339/public/v1.0/activityStructures/{activityStructureId}/{parentSetId}' \ --header 'Content-Type: application/json' \ --data '{ "id": "8DF9D0EC-2223-4EEA-8701-9531C5DC589C", "label": { "key": "Koordination" }, "set": { "id": "79000A86-F72D-4CAB-987B-C075AE2CC0C9", "label": { "key": "Tätigkeiten" }, "items": [ { "id": "12E1C174-9CA7-4CD8-B08A-F60986311A32", "label": { "key": "Intern" } }, { "id": "049F9429-6F67-483D-A475-C668EF987035", "label": { "key": "Extern" } } ] } }'

Example Response

No response body

Update Item

https://api.timerocket.ch/public/v1.0/activityStructures/{activityStructureId}/{parentSetId}/{itemId}

Updates an item in the activity structure.

Request

Field Type Description
activityBehavior OPTIONAL FIELD
string, either inherited, permitted or prohibited
Updates the activity behavior of the item that specifies whether activities can be added to this item.
inherited: inherit setting from above
permitted: activities can be added to this item
prohibited: activities cannot be added to this item
archived OPTIONAL FIELD
boolean
If set to true the item is archived and will not show up in searches anymore (until it is activated again).
If set to false the item is active again.
label JSON object literal The label of the item defines how the activity is displayed to the user.
label.key string The key to identify the item.
Acts as a fallback in case there is no translation given for the queried language.
label.translations JSON object literal Name of the item in different languages. Add a key/value pair per language with the key equal to the short language code ("de", "en", "fr", "it") and the value equal to the translation.

Response

If successful then the response is empty; otherwise the response contains a JSON object literal containing the error message.

Example Request: Update activity behavior

curl --location -g --request PUT 'http://localhost:58339/public/v1.0/activityStructures/{activityStructureId}/{parentSetId}/{itemId}' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{token}}' \ --data '{ "activityBehavior": "permitted" }'

Example Request: Update label

curl --location -g --request PUT 'https://api.timerocket.ch/public/v1.0/activityStructures/{activityStructureId}/{parentSetId}/{itemId}' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{token}}' \ --data '{ "label": { "key": "Neu", "fr": "Nouveau" } }'

Example Request: archive

curl --location -g --request PUT 'https://api.timerocket.ch/public/v1.0/activityStructures/{activityStructureId}/{parentSetId}/{itemId}' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{token}}' \ --data '{ "archived": true }'

Example Request: undo archive

curl --location -g --request PUT 'https://api.timerocket.ch/public/v1.0/activityStructures/{activityStructureId}/{parentSetId}/{itemId}' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{token}}' \ --data '{ "archived": false }'

Example Response

No response body

Delete Item

https://api.timerocket.ch/public/v1.0/activityStructures/{activityStructureId}/{parentSetId}/{itemId}

Deletes the item with the specified id in the specified parent set.

Example Request

curl --location -g --request DELETE 'https://api.timerocket.ch/public/v1.0/activityStructures/{activityStructureId}/{parentSetId}/{itemId}'

Example Response

No response body

Add Set

https://api.timerocket.ch/public/v1.0/activityStructures/{activityStructureId}/{parentSetId}/{itemId}

Adds a set to the specified item in the specified set. If there is already a set present, an error is returned.

StartFragment

Please refer to the description of Add Item for a description if the fields of the item (see fields starting with .set).

Response

If successful then the response is empty; otherwise the response contains a JSON object literal containing the error message.

Example Request

curl --location -g 'https://api.timerocket.ch/public/v1.0/activityStructures/{activityStructureId}/{parentSetId}/{itemId}' \ --header 'Content-Type: application/json' \ --data '{ "id": "FD3EC8FD-8897-4587-A558-2A9A37C0C5CC", "label": { "key": "Kunden" }, "items": [ { "id": "CD7B0E39-20F4-4BD4-865B-F6D440FA98BB", "label": { "key": "Meier Treuhand" } } ] }'

Example Response

No response body

Update Set

https://api.timerocket.ch/public/v1.0/activityStructures/{activityStructureId}/{setId}

Request

Field Type Description
activityBehavior OPTIONAL FIELD
string, either inherited, permitted or prohibited
Updates the activity behavior of the set that specifies whether activities can be added to items in this set (when not overridden).
inherited: inherit setting from above
permitted: activities can be added to items
prohibited: activities cannot be added to items
archived OPTIONAL FIELD
boolean
If set to true the setis archived and will not show up in searches anymore (until it is activated again).
If set to false the set is active again.
label JSON object literal The label of the set defines how the activity is displayed to the user.
label.key string The key to identify the set.
Acts as a fallback in case there is no translation given for the queried language.
label.translations JSON object literal Name of the set in different languages. Add a key/value pair per language with the key equal to the short language code ("de", "en", "fr", "it") and the value equal to the translation.

Response

If successful then the response is empty; otherwise the response contains a JSON object literal containing the error message.

Example Request: Update activity behavior

curl --location -g --request PUT 'http://localhost:58339/public/v1.0/activityStructures/{activityStructureId}/{setId}' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{token}}' \ --data '{ "activityBehavior": "prohibited" }'

Example Request: Update label

curl --location -g --request PUT 'http://localhost:58339/public/v1.0/activityStructures/{activityStructureId}/{setId}' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{token}}' \ --data '{ "activityBehavior": "prohibited" }'

Example Request: Update set

curl --location -g --request PUT 'https://api.timerocket.ch/public/v1.0/activityStructures/{activityStructureId}/{setId}' \ --header 'Authorization: Bearer {{token}}' \ --header 'Content-Type: application/json' \ --data '{ "archived": false }'

Example Response

No response body

Delete Set

https://api.timerocket.ch/public/v1.0/activityStructures/{activityStructureId}/{setId}

Deletes the set with the specified id.

Example Request

curl --location -g --request DELETE 'https://api.timerocket.ch/public/v1.0/activityStructures/{activityStructureId}/{setId}'

Example Response

No response body

Create Activity

https://api.timerocket.ch/public/v1.0/activities

Creates an activity.

Request

Field Type Description
activityStructureId Guid ID of the activity structure.
setId Guid ID of the set.
itemId Guid ID of the item.
activityId Guid ID of the activity. Must be unique.
affectedEmployeeId Guid ID of the employee the activity is added to.
Must be one of the IDs returned by .
executingEmployeeId Guid ID of the employee acting as the executer of the command.
Must be one of the IDs returned by .
workday date in the format yyyy-MM-dd The workday the activity is added to.
duration OPTIONAL FIELD: int The duration of the activity in minutes.
Either duration or from and to must be specified.
from OPTIONAL FIELD: time in the format HH:mm with +/-1 for night shifts (i.e. 23:50-1) When the activity started.
If specified to must be specified as well and duration must be omitted
to OPTIONAL FIELD: time in the format HH:mm with +/-1 for night shifts (i.e. 23:50-1) When the activity ended.
If specified from must be specified as well and duration must be omitted
description UTF8 string A text describing the activity.

Response

If successful then the response is empty; otherwise the response contains a JSON object literal containing the error message.

Example Request: With duration

curl --location 'https://api.timerocket.ch/public/v1.0/activities' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{token}}' \ --data '{ "activityStructureId": "AF44D54F-ABCE-40D0-B1F2-2019E09BBCA3", "setId": "CD4F80FE-47C8-4ADE-99B6-F90C1731AAC6", "itemId": "6675FD27-BEC6-4309-A8AA-F68E21BC1977", "activityId": "1D68F9CF-872D-4833-B77D-5539913C58C6", "executingEmployeeId": "E36A11C7-0C91-4A03-B86E-4509C08D632B", "affectedEmployeeId": "47E5CAB9-758C-4278-A828-8038891D2517", "workday": "2022-10-04", "duration": 180, "description": "worked 3 hours" }'

Example Request: With from-to

curl --location 'https://api.timerocket.ch/public/v1.0/activities' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{token}}' \ --data '{ "activityStructureId": "AF44D54F-ABCE-40D0-B1F2-2019E09BBCA3", "setId": "CD4F80FE-47C8-4ADE-99B6-F90C1731AAC6", "itemId": "6675FD27-BEC6-4309-A8AA-F68E21BC1977", "activityId": "1D68F9CF-872D-4833-B77D-5539913C58C6", "executingEmployeeId": "E36A11C7-0C91-4A03-B86E-4509C08D632B", "affectedEmployeeId": "47E5CAB9-758C-4278-A828-8038891D2517", "workday": "2022-10-04", "from": "2022-10-04T06:00", "to": "2022-10-04T10:00", "description": "worked 4 hours" }'

Example Response

No response body

Query Activities For Employees

https://api.timerocket.ch/public/v1.0/activities/forEmployees

Queries activities of employees.

Request

Field Type Description
employeeIds OPTIONAL: Array of GUIDs The list of employees for whom the activities are to be retrieved.
If not specified, activities for all employees are returned.
activityStructureId GUID The ID of the activity structure. Only activities of this activity structure are returned.
setId OPTIONAL FIELD: GUID The ID of the set. If the setId is provided the itemId must be present as well.
Only activities below the item with ID itemId in the set with the ID setId are returned.
Use this to query only a branch of the whole activity structure.
itemId OPTIONAL FIELD: GUID The ID of the item. If the itemId is provided the setId must be present as well.
Only activities below the item with ID itemId in the set with the ID setId are returned.
Use this to query only a branch of the whole activity structure.
start ISO 2014 date representation in the format yyyy-MM-dd Only activities on workdays between start and end are returned (including boundaries).
end ISO 2014 date representation in the format yyyy-MM-dd Only activities on workdays between start and end are returned (including boundaries).
includeActivitiesFromAttendance OPTIONAL FIELD: boolean If set to true, activities will be generated from attendance for employees with a corresponding rule configured.

Response

Field Type Description
activityId OPTIONAL FIELD: GUID The ID of the activity when it is a manually entered activity.
label JSON object literal The label defines how the activity should be presented to users.
label.key string The key of the activity. Should act as a fallback if no translation is present for a specific language.
label.translations JSON object literal The name of the activity in different languages. The keys in the JSON object represent a language ("de", "en", "fr", "it"), the values the translation.
employeeId GUID The employee's ID.
workday ISO 2014 date representation in the format yyyy-MM-dd The workday the activity is associated with.
activityStructureId GUID The ID of the activity structure the activity belongs to.
setId GUID The ID of the set the activity belongs to.
itemId GUID The ID of the item the activity belongs to.
duration OPTIONAL FIELD: number (minutes) The duration of the activity in minutes. Either duration or from and to are present.
from OPTIONAL FIELD: JSON object literal When the activity started. If from is present to is present as well, but no duration.
from.time Local time in the format hh:mm The time (local time) the activity started.
from.workdayShift OPTIONALE FIELD: number If present specifies how many days the workday has to be shifted to get the calendar day when the activity started. E.g. a workdayShift of -1 means that the activity started on the calendar day prior to the workday.
to JSON object literal When the activity ended. If to is present from is present as well, but no duration.
to.time Local time in the format hh:mm The time (local time) the activity ended.
to.workdayShift OPTIONALE FIELD: number If present specifies how many days the workday has to be shifted to get the calendar day when the activity ended. E.g. a workdayShift of 1 means that the activity ended on the calendar day following the workday.
description string The description that was passed along when the activity was created.

Example Request: Query activities for employees for set and item

curl --location --request GET 'https://api.timerocket.ch/public/v1.0/activities/forEmployees' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{token}}' \ --data '{ "employeeIds": [ "A7E5CAF9-758C-4278-A828-8038891D2517", "BB6AFFC6-5733-4492-A181-D88017DC3BA4"], "activityStructureId": "a0A4B813-09DF-4A91-9AFC-D756BEF031C3", "setId": "c2e7f944-0a41-4c87-95b5-9e1f6c71707f", "itemId": "ddf9d0ec-2223-4eea-8701-9531c5dc589c", "start": "2022-10-01", "end": "2022-10-31" }'

Example Request: Query all activities for employees

curl --location --request GET 'https://api.timerocket.ch/public/v1.0/activities/forEmployees' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{token}}' \ --data '{ "employeeIds": [ "A7E5CAF9-758C-4278-A828-8038891D2517", "BB6AFFC6-5733-4492-A181-D88017DC3BA4"], "activityStructureId": "40A4B813-09DF-4A91-9AFC-D756BEF031C3", "start": "2022-10-01", "end": "2022-10-31" }'

Example Response

[ { "activityId": "2d68f9cf-872d-4833-b77d-5539913c58c6", "label": { "label": "?", "translations": {} }, "employeeId": "bb6affc7-5733-4492-a181-d88017dc3ba4", "workday": "2022-10-04", "activityStructureId": "a0a4b813-09df-4a91-9afc-d756bef031c3", "setId": "c2e7f944-0a41-4c87-95b5-9e1f6c71707f", "itemId": "ddf9d0ec-2223-4eea-8701-9531c5dc589c", "duration": 10, "description": "worked 10 minutes" }, { "activityId": "1d68f9cf-872d-4833-b77d-5539913c58c6", "label": { "label": "?", "translations": {} }, "employeeId": "bb6affc7-5733-4492-a181-d88017dc3ba4", "workday": "2022-10-04", "activityStructureId": "a0a4b813-09df-4a91-9afc-d756bef031c3", "setId": "c2e7f944-0a41-4c87-95b5-9e1f6c71707f", "itemId": "ddf9d0ec-2223-4eea-8701-9531c5dc589c", "duration": 180, "description": "worked 3 hours" } ]

Retired

Query Attendance Information

https://api.timerocket.ch/public/v1.0/attendance

Queries the current attendance information of an employee via her/his custom ID.

Request

* Either use catalogueName in combination with customId or just use employeeId

Field Type Description
workday ISO 2014 date representation in the format yyyy-MM-dd Specifies for which date the information will get queried (normally you want the information of todays date)
catalogueName String with max. 255 characters, only letters and digits are allowed The catalogueName you specified in https://api.timerocket.ch/public/v1.0/customIds
customId String with max. length 255, only letters and digits are allowed The ID associated by your device/application to a badge or fingerprint of the person you want to query
employeeId Guid, all uppercase TimeRocket Employee ID
language ISO 639-1 language code The language in which the response shall be rendered

Response

Field Type Description
currentTime UTC date and time in the format yyyy-MM-ddTHH:mm Current server time
timeStamps All time stamps of the queried person on the specified workday
timeStamps[].id Guid, all uppercase ID of a time stamp
timeStamps[].time UTC date and time incl. time offset to UTC and origin time zone (tz db name) in the format yyyy-MM-ddTHH:mm:ss +/-hh:mm () Point in time when the timestamp happened
todaysAttendance Integer representing minutes Attendance of the queried person on the specified workday (only closed presence blocks).
hasConversionRate Boolean Specifies if there is a conversion rate for this person
conversionRate OPTIONAL FIELD: integer representing minutes Duration of a day specified for the queried person (if a persons workday duration is 8 hours and 12 minutes, the conversionRate would be 492)
accounts All accounts of the queried person with the values on the specified workday (only closed presence blocks).
accounts[].id Guid, all uppercase ID of account
accounts[].label UTF-8 string Account label in the queried language
accounts[].total Integer representing minutes Account value on the specified workday (only closed presence blocks).
status Status of the queried person on the specified workday as of now (currentTime)
status[].id Guid, all uppercase See status IDs
status[].label UTF-8 string Label of the current status in the queried language

Account IDs

ID Description
D9BEF6C1-C272-461F-93E1-D987C0D8CEE8 Extra hours
54A4181D-255D-4CE0-9450-672B0D86E209 Overtime
CAB20D1C-567B-4991-AEEF-E2B0A976AF67 Vacation

Status IDs

ID Description
520B2CB1-6CFC-4A9B-9279-F9A23BF598F6 Present
C073D1EA-3295-464F-BBEA-A33AE4734F01 Absent
7FD7FEDB-3458-47D7-BA85-1C167F050493 Unknown

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/attendance' \ --header 'Authorization: Bearer {{token}}' \ --data '{ "workday": "2021-01-05", "catalogueName": "catalogueNameUsedForImport", "customId": "a123456xy", "language": "de" }'

Example Response: With conversion rate

{ "currentTime": "2021-01-30T16:47", "timeStamps": [ { "id": "233894D2-963B-4B3A-940E-3D2B17EF465F", "time": "2021-01-30T06:35:00 +01:00 (Europe/Zurich)" }, { "id": "0DB1BEDF-DC14-4686-91A6-BCB82B52EA93", "time": "2021-01-30T10:16:00 +01:00 (Europe/Zurich)" } ], "todaysAttendance": 221, "hasConversionRate": true, "conversionRate": 492, "accounts": [ { "id": "54A4181D-255D-4CE0-9450-672B0D86E209", "label": "Überstunden", "total": 849 }, { "id": "CAB20D1C-567B-4991-AEEF-E2B0A976AF67", "label": "Ferien", "total": 9510 } ], "status": { "id": "C073D1EA-3295-464F-BBEA-A33AE4734F01", "label": "Abwesend" } }

Example Response: Without conversion rate

{ "currentTime": "2021-01-30T16:47", "timeStamps": [ { "id": "233894D2-963B-4B3A-940E-3D2B17EF465F", "time": "2021-01-30T06:35:00 +01:00 (Europe/Zurich)" }, { "id": "0DB1BEDF-DC14-4686-91A6-BCB82B52EA93", "time": "2021-01-30T10:16:00 +01:00 (Europe/Zurich)" }, { "id": "588CD035-E578-40D6-A9D3-F037FD2FB697", "time": "2021-01-30T12:30:00 +01:00 (Europe/Zurich)" } ], "todaysAttendance": 418, "hasConversionRate": false, "accounts": [ { "id": "54A4181D-255D-4CE0-9450-672B0D86E209", "label": "Überstunden", "total": 849 }, { "id": "CAB20D1C-567B-4991-AEEF-E2B0A976AF67", "label": "Ferien", "total": 9510 } ], "status": { "id": "520B2CB1-6CFC-4A9B-9279-F9A23BF598F6", "label": "Anwesend" } }

Response codes

Custom ID and/or catalogue name does not exist Status Code 428 - Precondition required
Custom ID not linked to employee Status Code 406 - Not acceptable
Invalid request Status Code 417 - Expectation failed

Query Attendance Range Information

https://api.timerocket.ch/public/v1.0/attendance/range

Queries all employees and their attendance times per day

Request

Field Type Description
employeeIds array The TimeRocket ID of the employees.
from ISO 2014 date representation in the format yyyy-MM-dd Specifies the "from" date of the query range.
to ISO 2014 date representation in the format yyyy-MM-dd Specifies the "to" date of the query range.

Response

** if the workday is today and there is an odd number of timestamps, the presence and actual time are filled up to the current instant

Field Type Description
employeeId GUID The TimeRocket ID of the employee.
employeeName string Name of employee
workday ISO 2014 date representation in the format yyyy-MM-dd The workday the presence are associated with.
presence integer representing minutes Presence on the respective day
(2 hours and 12 minutes = 132) **
actualTime integer representing minutes Actual time (presence plus absence) on the respective day
(2 hours and 12 minutes = 132) **
targetTime integer representing minutes Target time (per contract) on the respective day
(2 hours and 12 minutes = 132)

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/attendance/range' \ --header 'Authorization: Bearer {{token}}' \ --header 'Content-Type: application/json' \ --data '{ "employeeIds": [ "A7E5CAF9-758C-4278-A828-8038891D2517", "BB6AFFC6-5733-4492-A181-D88017DC3BA4" ], "from": "2023-05-01", "to": "2023-05-31" }'

Example Response

[ { "employeeId": "DE7DFAAF-0B4C-4238-9CE1-54D623B1E30C", "employeeName": "Muster Max", "workday": "2020-01-10", "presence": 42, "actualTime": 43, "targetTime": 44 } ]

Query Timeblocks

https://api.timerocket.ch/public/v1.0/timeblocks

Queries the timeblocks of all specified employees.

Request

Field Type Description
employeeIds array The TimeRocket ID of the employees.
from ISO 2014 date representation in the format yyyy-MM-dd Specifies the "from" date of the query range.
to ISO 2014 date representation in the format yyyy-MM-dd Specifies the "to" date of the query range.

Response

Field Type Description
employeeId GUID The TimeRocket ID of the employee.
workday ISO 2014 date representation in the format yyyy-MM-dd The workday the time blocks are associated with.
timeblocks array The time blocks of the workday with all details (these time blocks can overlap)
timeblocks[].start Information on the start time of the time block
timeblocks[].start.time string (HH:mm) Time at which the time block started
timeblocks[].start.workdayShift int Specifies by how much the time stamp deviates from the workday (0 = same day, -1 = previous day, 1 = following day).
timeblocks[].end OPTIONAL
string (HH:mm)
Information on the end time of the time block.
Only available for closed blocks. If, e.g. the employee is still present, the latest working block will not have an end.
timeblocks[].end.time string (HH:mm) Time at which the time block ended
timeblocks[].end.workdayShift int Specifies by how much the time stamp deviates from the workday (0 = same day, -1 = previous day, 1 = following day).
timeblocks[].duration integer representing minutes Duration of a time block specified for the queried person (2 hours and 12 minutes = 132)
timeblocks[].kind string Working = Working Block

Presence = Presence (first stamp to last stamp)

CoreTimeViolation = Violation of core time

Break Stamped = Stamped break by employee

Break Extension = Stamped break was extended by rule

Break Generated = Pause was automatically entered by the system

FlexibleTimeViolation = Violation of flexible time

BlockingTimeViolation = Violation of blocking time
sequentialWorkingBlocks The time blocks of the working day with the effectively credited times (these time blocks do not overlap)
sequentialWorkingBlocks[].start
sequentialWorkingBlocks[].start.time string (HH:mm) Time at which the time block started
sequentialWorkingBlocks[].start.workdayShift int Specifies by how much the time stamp deviates from the workday (0 = same day, -1 = previous day, 1 = following day).
sequentialWorkingBlocks[].end
sequentialWorkingBlocks[].end.time string (HH:mm) Time at which the time block started
sequentialWorkingBlocks[].end.workdayShift int Specifies by how much the time stamp deviates from the workday (0 = same day, -1 = previous day, 1 = following day).
sequentialWorkingBlocks[].duration integer representing minutes Duration of a time block specified for the queried person (2 hours and 12 minutes = 132)

Example Request

curl --location 'https://api.timerocket.ch/public/v1.0/timeblocks' \ --header 'Authorization: Bearer {{token}}' \ --header 'Content-Type: application/json' \ --data '{ "employeeIds": [ "A7E5CAF9-758C-4278-A828-8038891D2517", "BB6AFFC6-5733-4492-A181-D88017DC3BA4" ], "from": "2023-05-01", "to": "2023-05-31" }'

Example Response

[ { "employeeId": "00000000-0000-0000-0000-000000000001", "workday": "2023-01-01", "timeblocks": [ { "start": { "time": "08:00", "workdayShift": 0 }, "end": { "time": "12:00", "workdayShift": 0 }, "duration": 240, "kind": "Working" } ], "sequentialWorkingBlocks": [ { "start": { "time": "08:00", "workdayShift": 0 }, "end": { "time": "12:00", "workdayShift": 0 }, "duration": 240 } ] } ]