Create Timesheets API

This API is used to create new timesheets.

Request URL:

https://people.zoho.com/people/api/timetracker/createtimesheet?user=<user>&timesheetName=<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:

ParameterValues AllowedDefault ValueDescription
*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-ddSpecify 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
jobIdall | <Job Id>allSpecify the job Id
projectIdall | <Project Id>allSpecify the project Id
clientIdall | <Client Id>allSpecify the client Id
billableStatusall | <Billable> | <Non-Billable>allSpecify the billable status of the timelogs
sendforApprovaltrue | falsefalseTo 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 CodeError Message
9000Permission denied
9002No <parameter name> parameter specified
9003Wrong value given for <parameter name> parameter
9004Wrong date format given for <parameter name> parameter
9005Time Tracker tab is disabled
9006toDate should be after the fromDate
9007Maximum of one month's data can only be fetched at a time
9009Payment has already been processed for all time logs/timesheets until <pay period processing date>. Hence, you cannot perform this action
9031No 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>