Get Timesheets API
This API is used to get the list of timesheets.
Request URL:
https://people.zoho.com/people/api/timetracker/gettimesheet?user=<user>&approvalStatus=<approvalStatus>&employeeStatus=<employeeStatus>&dateFormat=<dateFormat>&fromDate=<fromDate>&toDate=<toDate>&sIndex=<sIndex>&limit=<limit>
Header:
Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxx9be93.9b8xxxxxxf
Scope:
ZOHOPEOPLE.timetracker.ALL
OR
ZOHOPEOPLE.timetracker.READ
Possible Operation Types:
ALL - Complete access to data
READ - Only to read data
Parameter | Values Allowed | Default Value | Description |
*user | all | <Email Id> | <Employee Id> | <Erec No> | <Mandatory> | Specify the user whose timesheets have to be fetched |
dateFormat | <Date format> | Company date format | Specify the format in which the dates should be provided |
fromDate | <From date> | - | Specify the "from date" of the timesheet |
toDate | <To date> | - | Specify the "to date" of the timesheet |
approvalStatus | all | draft | pending | approved | rejected | all | Specify the approval status of the timesheet |
employeeStatus | users | nonusers | usersandnonusers | logindisabled | usersandnonusers | Specify the status of the employees whose timesheets have to be fetched |
sIndex | <sIndex> | 0 | Specify from which record the response should be fetched |
limit | <limit> | 200 | Specify the number of records to be fetched. Maximum value is 200 |
Error Codes and Messages :
Error Code | Error Message |
9000 | Permission denied |
9002 | No <parameter name> parameter specified |
9003 | Wrong value given for <parameter name> parameter |
9004 | Wrong date format given for <parameter name> parameter |
9005 | Time Tracker tab is disabled |
9006 | toDate should be after the fromDate |
Success Response Format
{
"response": {
"result": [
{
"recordId": <Timesheet Id>,
"listId": <Timesheet Id>,
"timesheetName": <Timesheet name>,
"erecno": <User Id>,
"employeeName": <User name>,
"employeeId": <Employee Id>,
"employeeEmail": <User mail Id>,
"description": <Description>,
"fromDate": <Timesheet start date>,
"toDate": <Timesheet end date>,
"owner": <Owner Id>,
"status": <Draft | Pending | Approved | Rejected>,
"currency": <Currency code>,
"billableHours": <Total billable hours in HH:mm>,
"nonbillableHours": <Total non billable hours in HH:mm>,
"totalHours": <Total hours in HH:mm>,
"approvedBillableHours": <Approved billable hours in HH:mm>,
"approvedNonBillableHours": <Approved non billable hours in HH:mm>,
"approvedTotalHours": <Approved total hours in HH:mm>,
"ratePerHour": <Employee rate per hour>,
"approvedRatePerHour": <Approved rate>,
"totalAmount": <Total amount>,
"approvedTotalAmount": <Approved total amount>
},....
],
"message": "Data fetched successfully",
"uri": "/api/timetracker/gettimesheet",
"status": 0
}
}
Error Response Format
{
"response": {
"message": "Error in fetching data",
"uri": "/api/timetracker/gettimesheet",
"errors": [
{
"code": <Error Code>,
"message": <Error Message>
}
],
"status": 1
}
}
Threshold Limit: 50 requests | Lock period: 5 minutes
Threshold Limit - Number of API calls allowed within a minute.
Lock Period - Wait time before consecutive API requests.
Sample Request
Copiedhttps://people.zoho.com/people/api/timetracker/gettimesheet?user=eliza.madison@gmail.com&approvalStatus=approved&employeeStatus=users&dateFormat=dd-MMM-yyyy&fromDate=07-Apr-2019&toDate=13-Apr-2019&sIndex=0&limit=1
Request
Header
CopiedAuthorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxx9be93.9b8xxxxxxf
Sample Response
Copied{
"response": {
"result": [
{
"owner": "469505000000133005",
"formId": "469505000000118001",
"nonbillableHours": "03:48",
"employeeName": "Eliza Madison",
"erecno": "469505000000133005",
"totalHours": "04:48",
"toDate": "13-Apr-2019",
"description": "Worked on System/Requirement Analysis",
"employeeEmail": "eliza.madison@gmail.com",
"approvedBillableHours": "01:00",
"employeeId": "ID - 1",
"billableHours": "01:00",
"recordId": "469505000000272183",
"listId": "469505000000272183",
"fromDate": "07-Apr-2019",
"totalAmount": "100.00",
"approvedNonBillableHours": "00:00",
"approvedRatePerHour": 100,
"approvedTotalAmount": "100.00",
"ratePerHour": 100,
"timesheetName": "Weekly Timesheet (07-Apr-2019 - 13-Apr-2019)",
"currency": "USD",
"approvedTotalHours": "01:00",
"status": "Approved"
}
],
"message": "Data fetched successfully",
"uri": "/api/timetracker/gettimesheet",
"status": 0
}
}
Copied<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/timetracker/gettimesheet">
<status>0</status>
<message>Data fetched successfully</message>
<result>
<timesheet>
<owner>469505000000133005</owner>
<formId>469505000000118001</formId>
<nonbillableHours>03:48</nonbillableHours>
<employeeName>Eliza Madison</employeeName>
<erecno>469505000000133005</erecno>
<totalHours>04:48</totalHours>
<toDate>13-Apr-2019</toDate>
<description>Worked on System/Requirement Analysis</description>
<employeeEmail>eliza.madison@gmail.com</employeeEmail>
<approvedBillableHours>01:00</approvedBillableHours>
<employeeId>ID - 1</employeeId>
<billableHours>01:00</billableHours>
<recordId>469505000000272183</recordId>
<listId>469505<<000000272183</listId>
<fromDate>07-Apr-2019</fromDate>
<totalAmount>100.00</totalAmount>
<approvedNonBillableHours>00:00</approvedNonBillableHours>
<approvedRatePerHour>100.0</approvedRatePerHour>
<approvedTotalAmount>100.00</approvedTotalAmount>
<ratePerHour>100.0</ratePerHour>
<timesheetName>Weekly Timesheet (07-Apr-2019 - 13-Apr-2019)</timesheetName>
<currency>USD</currency>
<approvedTotalHours>01:00</approvedTotalHours>
<status>Approved</status>
</timesheet>
</result>
</response>