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:
Parameters | Values Allowed | Default Value | Description |
*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-dd | Specify the date format. |
billingStatus | <billable/non-billable> | Default Billing status based on settings | Specify the Billiable status |
hours | <hours in decimal/time format> | 0 | Decimal-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 |
timer | start | - | 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 Code | Error Message |
8000 | No parameter specified |
8002 | Wrong format for parameter |
8001 | Wrong value for parameter |
7038 | Permission denied |
8008 | Cannot 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>