Add Time Logs API

This API is used to add time logs.

Request URL:

https://people.zoho.com/people/api/timetracker/addtimelog?user=<user>&workDate=<workDate>&jobId=<jobId>&hours =<hours>workItem=<workItem>&billingStatus=<billingStatus>&description=<description>

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:

ParametersValues AllowedDefault ValueDescription
*user< ERECNO | Email-ID | Employee-ID ><Mandatory>Specify the user for whom timelog needs to be added
*jobId<jobId><Mandatory>Specify the job Id for which the timelog needs to be done
projectId<projectId>-Specify the project Id of the job if needed
projectName<projectName>-Specifying project name will create a new project based on the form add permission of the user
jobName<jobName>-Specifying job name will create a new job based on the form add permission of the user
clientId<clientId>Specify the client Id of the project if needed, will be considered only if projectName param is specified
clientName<clientName>Specify the client name of the project if needed, will be considered only if projectName param is specified 
*workDate<date in yyyy-MM-dd/company dateformat><Mandatory>Specify the work date for when timelog needs to be added
dateFormat<dateformat>yyyy-MM-ddSpecify the date format.
billingStatus<billable/non-billable>Default Billing status based on settingsSpecify the Billiable status
hours<hours in decimal/time format>0Decimal-2.5 or Time format-2:30
fromTime<time in timeformat>-Time format-2:30PM or 14:30
toTime<time in timeformat>-Time format-2:30PM or 14:30
timerstart-To add the timer log
workItem<workitem>-Specify the workitem
description<description>-Specify the description

Note: Either Hour or From - To time or timer:start has to be sent in the request

Error Codes & Messages:

Error CodeError Message
8000No parameter specified
8002Wrong format for parameter
8001Wrong value for parameter
7038Permission denied
8008Cannot log time during Weekend/Holidays/Leave

 

Messages
Error in modifying data
Manual Log is disabled in Settings. Contact your Administrator.
Cannot log time for a Future Date
Cannot log time for a Past Date
You can log time only for the past 7 days
Unable to add/modify time log. Logged hours should not exceed 24 hours per day.
Logged-in user alone can start timer
Error in adding/modifying Timelog.Logged Hours is greater than maximum billable hours allowed per day
Cannot log time beyond attendance hours
Error in adding/modifying Timelog.Logged Hours is greater than Estimated hours

Success Response Format

{
    "response": {
        "result": [
            {
                "timeLogId": "< timelogId >"
            }
        ],
        "message": "Timelog entry added Successfully",
        "uri": "/api/timetracker/addtimelog",
        "status": 0
    }
}

Error Response Format

{
  "response": {
    "message": < message>,(NOTE: refer the table below)
   "uri": "/api/timetracker/addtimelog",
    "errors": [
      {
        "code": < error_code >,
        "message": < error_message >
      }],
    "status": 1
  }
}

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/addtimelog?user=charles@zohocorp.com&jobName=Testing&workDate=2015-01-05&billingStatus=Billable&hours=10

Header

CopiedAuthorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxx9be93.9b8xxxxxxf

Sample Response

Copied{
    "response": {
        "result": [
            {
                "timeLogId": "469505000000265019"
            }
        ],
        "message": "Timelog entry added Successfully",
        "uri": "/api/timetracker/addtimelog",
        "status": 0
    }
}
Copied<?xml version="1.0" encoding="UTF-8"?>
 <response uri="/api/timetracker/addtimelog">
       <status>0</status>
       <message>Timelog entry added Successfully</message>
       <result>
	      <timeLogId>469505000000265019</timeLogId>
       </result>
 </response>