API
Use TimeTrack Rest API to integrate TimeTrack with other systems.
Happy Coding!
With this endpoint you can:
Absence object has following params:
Param | Type | Description |
---|---|---|
ID | Integer | ID |
user | Text | Username of user |
from | Text | Start date – Format: YYYY-MM-DD |
to | Text | End date- Format: YYYY-MM-DD |
status | Integer | Absence state: 0 – new and waiting for approval, 1 – approved, 2 – disapproved |
absenceType | Integer | ID of absence type |
absenceTypeName | Text | Short name / short code of absence type |
curl “https://testaccount.timetrackenterprise.com/api/v2/ext/absences/”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’
Following params can be used for search / filter:
Param | Type | Description |
---|---|---|
user | Text | Username of user |
from | Text | Date – Format: YYYY-MM-DD |
to | Text | Date – Format: YYYY-MM-DD |
absenceType | Integer | ID of absence type |
In this example we get all absences of user “tester” between 2020-10-01 and 2020-10-31
curl “https://testaccount.timetrackenterprise.com/api/v2/ext/absences?username= tester&from=2020-10-01&to=2020-10-31”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’
Required params: ID
curl “https://testaccount.timetrackenterprise.com/api/v2/ext/absences/1”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’
You can use all params of Absence object.
Required params: username, from, to, absenceType
curl -X “POST” “https://testaccount.timetrackenterprise.com/api/v2/ext/absences”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{
“username”: “tester”,
“absenceType”: 1,
“to”: “2020-10-28”,
“from”: “2020-10-26”
}’
You can update following params: status.
curl -X “PUT” “https://testaccount.timetrackenterprise.com/api/v2/ext/absences/1”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{
“status”: 1
}’
curl -X “DELETE” “https://testaccount.timetrackenterprise.com/api/v2/ext/absences/1”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’