API
Use TimeTrack Rest API to integrate TimeTrack with other systems.
Happy Coding!
With timer endpoint you can:
Project timer object has following params:
Param | Type | Description |
---|---|---|
username | Text | Username |
startedAt | Text | Start Timestamp |
workedSeconds | Integer | Last saved work duration in seconds. If current timer state is Playing / Running, then you need to calculate work duration yourself with: Difference between now and startedAt – breakSeconds = workedSeconds |
breakSeconds | Integer | Last saved break duration in seconds. If current timer state is Paused / Break, then you need to calculate break duration yourself with: Difference between now and startedAt – workedSeconds = breakSeconds |
playing | Boolean | flag true or false |
stopped | Boolean | flag true or false |
paused | Boolean | flag true or false |
clientName | Text | Client name |
projectName | Text | Project name |
taskName | Text | Task name |
note | Text | Notes |
IMPORTANT: For each request you have to pass the local timestamp in order to get the right duration. This date must be in same timezone like you are currently, we will use it on server to calculate workedDuration and breakDuration.
curl “https://testaccount.timetrackenterprise.com/api/v2/ext/project_timer?username=test&date=2020-10-23T16:00:00.000Z”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’
Required params to start project timer: date, clientName, projectName, username
curl -X “POST” “https://testaccount.timetrackenterprise.com/api/v2/ext/project_timer/start”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{
“username”: “test”,
“clientName”: “Client 006”,
“projectName”: “Project 006_1”,
“date”: “2020-10-23T15:00:00.000Z”
}’
Required params to pause project timer: date, username
curl -X “POST” “https://testaccount.timetrackenterprise.com/api/v2/ext/project_timer/pause”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{
“date”: “2020-10-23T15:30:00.000Z”,
“username”: “test”
}’
Required params to resume project timer: date, username
curl -X “POST” “https://testaccount.timetrackenterprise.com/api/v2/ext/project_timer/resume”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{
“date”: “2020-10-23T15:30:00.000Z”,
“username”: “test”
}’
Required params to stop project timer: date, username
curl -X “POST” “https://testaccount.timetrackenterprise.com/api/v2/ext/project_timer/stop”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{
“date”: “2020-10-23T15:30:00.000Z”,
“username”: “test”
}’
Attendance timer object has following params:
Param | Type | Description |
---|---|---|
id | Integer | ID |
user | Text | Username |
latitudeStart | Number | Start GPS coordinates – Latitude |
longitudeStart | Number | Start GPS coordinates – Longitude |
latitudeEnd | Number | Stop GPS coordinates – Latitude |
latitudeEnd | Number | Stop GPS coordinates – Longitude |
from | Text | Start Timestamp |
to | Text | End Timestamp |
workedMinutes | Integer | Duration in minutes |
breakMinutes | Integer | Break duration in minutes |
manual | Boolean | Flag to show if entry was created manually or with timer. You can create Attendance entry in Web-App manually without end timestamp, this is the same as starting the attendance timer. |
notes | Text | Notes |
Required params: date.
curl “https://testaccount.timetrackenterprise.com/api/v2/ext/attendance_timer?username=test&date=2020-10-23T16:00:00.000Z”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’
Required params: date, username
curl -X “POST” “https://testaccount.timetrackenterprise.com/api/v2/ext/attendance_timer/start”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{
“username”: “test”,
“date”: “2020-10-23T15:00:00.000Z”
}’
Required params: date, username
curl -X “POST” “https://testaccount.timetrackenterprise.com/api/v2/ext/attendance_timer/stop”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{
“username”: “test”,
“date”: “2020-10-23T15:00:00.000Z”
}’