API
Use TimeTrack Rest API to integrate TimeTrack with other systems.
Happy Coding!
With Employee Reports you can generate reports for employees for specific time period.
TimeTrack generates for each user and day timesheet records (daily report). You can get those records or you can get the grouped reports for specific time period.
With reports endpoint you can:
Daily-Reports have following params:
Param | Type | Description |
---|---|---|
username | Text | Username |
workDate | Text | Date in format YYYY-MM-DD |
workStart | Text | Start timestamp |
workEnd | Text | End timestamp |
targetSeconds | Integer | Target hours in seconds |
workedSeconds | Integer | Actual hours in seconds |
workTargetDifference | Integer | Difference between actual and target |
breakSeconds | Integer | Break duration in seconds |
breakTimes | Text | Break times |
surchargeSeconds | Integer | Duration of surcharged time in seconds |
holidaySeconds | Integer | Duration of holiday time based on working model of employee. If on this date its a holiday and this is the regular working day for this employee, the holidaySeconds will be filled. |
absence1Seconds | Integer | Duration of absence 1 on this day |
absence1ShortName | Text | Absence 1 short code |
absence2Seconds | Integer | Duration of absence 2 on this day |
absence2ShortName | Text | Absence 2 short code |
absence3Seconds | Integer | Duration of absence 3 on this day |
absence3ShortName | Text | Absence 3 short code |
weekday | Integer | Index of weekday, 1 to 7. If its a holiday it will be 8. |
holiday | Boolean | Flag if this day is a holiday |
In this example we get all daily reports for user test between 2020-10-01 and 2020-10-31
curl “https://testaccount.imetrackenterprise.com/api/v2/ext/work_reports?username=test&from=2020-10-01T00:00:00Z&to=2020-10-31T00:00:00Z”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’
Grouped report has following params:
Param | Type | Description |
---|---|---|
username | Text | Username |
targetSeconds | Integer | Sum of target in seconds |
workedSeconds | Integer | Sum of actual in seconds |
workTargetDifference | Integer | Sum of difference between actual and target |
surchargedSeconds | Integer | Sum of surcharged time in seconds |
holidaySeconds | Integer | Sum of holiday time in seconds. |
absenceSeconds | Integer | Sum of absences in seconds |
targetSecondsDisplay | Integer | Sum of target in HH:mm |
workedSecondsDisplay | Integer | Sum of actual in HH:mm |
workTargetDifferenceDisplay | Integer | Sum of difference in HH:mm |
surchargedSecondsDisplay | Integer | Sum of surcharged in HH:mm |
holidaySecondsDisplay | Integer | Sum of holiday seconds in HH:mm. |
absenceSecondsDisplay | Integer | Sum of absence seconds in HH:mm |
absences | List of Absence-Objects | Absence list |
overtimeCarries | List of OvertimeCarryObjects | Overtime carries in this year |
vacationCarries | List of VacationCarryObject | Vacation carries in this year |
In this example we generate report for user test for following time period 2020-08-01 – 2020-10-31
curl “https://testaccount.imetrackenterprise.com/api/v2/ext/work_reports/group?username=test&from=2020-08-01T00:00:00Z&to=2020-10-31T00:00:00Z”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’