Create Timesheets API
This API is used to create new timesheets.
Request URL:
https://people.zoho.com/people/api/timetracker/createtimesheet?user=<user>×heetName=<timesheetName>&description=<description>&dateFormat=<dateFormat>&fromDate=<fromDate>&toDate=<toDate>&billableStatus=<billableStatus>&jobId=<jobId>&projectId=<projectId>&clientId=<clientId>&sendforApproval=<sendforApproval>
Header:
Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxx9be93.9b8xxxxxxf
Scope:
ZOHOPEOPLE.timetracker.ALL
OR
ZOHOPEOPLE.timetracker.CREATE
Possible Operation Types:
ALL - Complete access to data
CREATE - Only to add data
Request parameter:
Parameter | Values Allowed | Default Value | Description |
*user | <Email Id> | <Employee Id> | <Erec No> | <Mandatory> | Specify the user for whom timesheet has to be created |
*timesheetName | <Timesheet name> | <Mandatory> | Specify the timesheet name |
dateFormat | <Date format> | yyyy-MM-dd | Specify the format in which the dates should be provided |
*fromDate | <Timesheet from date> | <Mandatory> | Specify the from date |
*toDate | <Timesheet to date> | <Mandatory> | Specify the to date |
description | <Description> | - | Specify the description |
jobId | all | <Job Id> | all | Specify the job Id |
projectId | all | <Project Id> | all | Specify the project Id |
clientId | all | <Client Id> | all | Specify the client Id |
billableStatus | all | <Billable> | <Non-Billable> | all | Specify the billable status of the timelogs |
sendforApproval | true | false | false | To submit the timesheet for approval |
Note:To attach a file to the timesheet, set the content type of the request as "multipart/form-data" and attach the file in the request body with the key name as "attachment".
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 |
9007 | Maximum of one month's data can only be fetched at a time |
9009 | Payment has already been processed for all time logs/timesheets until <pay period processing date>. Hence, you cannot perform this action |
9031 | No timelogs found for these conditions |
Success Response Format
{
"response": {
"result": {
"timesheetId": [
<Array of timesheet Ids>
]
},
"message": <Message>,
"uri": "/api/timetracker/createtimesheet",
"status": 0
}
}
Error Response Format
{
"response": {
"message": "Error in adding data",
"uri": "/api/timetracker/createtimesheet",
"errors": [
{
"code": <Error Code>,
"message": <Error Message>
}
],
"status": 1
}
}
Resubmit Timesheets API
To resubmit the rejected time sheet, use Modify Timesheet API and add "isResubmit" parameter to the request with the value as "true".
Threshold Limit: 20 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/createtimesheet?user=eliza.madison@gmail.com×heetName=Daily Timesheet&description=Worked on System Analysis&dateFormat=dd-MM-yyyy&fromDate=07-04-2019&toDate=07-04-2019&billableStatus=all&jobId=all&projectId=all&clientId=all&sendforApproval=true
Request
Header
CopiedAuthorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxx9be93.9b8xxxxxxf
Sample Response
Copied{
"response": {
"result": {
"timesheetId": [
"469505000000271133"
]
},
"message": "Data added successfully",
"uri": "/api/timetracker/createtimesheet",
"status": 0
}
}
Copied<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/timetracker/createtimesheet">
<status>0</status>
<message>Data added successfully</message>
<result>
<timesheetId>["469505000000271133"]</timesheetId>
</result>
</response>