Bulk Time Logs API

This API is used to add or edit time logs in bulk.

Request URL:

https://people.zoho.com/people/api/timetracker/addupdatetimelogs

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:

ParametersDescription
timelogs[{
   "user": <ErecNo | Employee ID | Mail ID>
   "jobId": <Job ID>
   "timelogId": <Time log ID> (To be provided, only if an existing time log
                                                            has to be edited)
   "date": <YYYY-MM-dd>
   "billableStatus": <billable | non-billable>
   "hours": <HH:mm> (Considered only if start and end time are not given)
   "startTime": <HH:mm AM | HH:mm PM>
   "endTime": <HH:mm AM | HH:mm PM>
   "workItem": <Not more than 15000 characters> (Optional)
   "description": <Not more than 15000 characters> (Optional)
 },..............]

Note: It is recommended to specify the above parameter in the request body since appending it to the api url may throw URL_LENGTH error especially when multiple timelogs are added or edited.

Limitations:

  • Using this API, only upto a 100 timelogs can be added or edited at a time.
  • "Hours" based or "Start-End Time" based time logs can be added or edited
  • "Timer" based time logs cannot be added or edited.
  • Using this API, only the timelogs for a consecutive 31 days can be added or edited at a time.

Success Response Format

 {
    "response": {
        "result": {
            "addedTimelogIds": <Array of added time log IDs>,
            "editedTimelogIds": <Array of edited time log IDs>,
            "errorLogs": [ (Will be available only if any of the given time logs have failed to       
                                                                                                                    be added/updated)
                {
                    "errorCode": <Error Code>,
                    "message": <Error Message>,
                    "user": <User Id>,
                    "date": <YYYY-MM-dd>,
                    "jobId": <Job Name>,
                    "hours": <Hours>
                },..........
           ],
          "message": "Data updated successfully",
          "uri": "/api/timetracker/addupdatetimelogs",
          "status": 0
    }
}

Error Response Format

{
    "response": {
        "message": "Error in updating data",
        "uri": "/api/timetracker/addupdatetimelogs",
        "errors": {
            "erorLogs": [
                {
                    "errorCode": <Error Code>,
                    "message": <Error Message>,
                    "user": <User Id>,
                    "date": <YYYY-MM-dd>,
                    "jobId": <Job Name>,
                    "hours": <Hours>
                },..........
            ]
        },
        "status": 1
    }
}

Request parameter appended in the request body for the given JSON example on the right section:

ParametersDescription
timelogs{
   "user": cole.thompson@innovatorhub.com
   "jobId": 3000163849028
   "date": 2022-02-01
   "billableStatus": billable
   "startTime": 10:00 AM
   "endTime": 11:00 AM
   "workItem": "Developing design for the new user interface"
 },{
   "user": devin.connor@innovatorhub.com
   "jobId": 3000163849024,
   "timelogId": 3000123412397
   "date": 2022-01-31
   "billableStatus": non-billable
   "startTime": 11:30 AM
   "endTime": 01:30 PM
   "workItem": "Optimizing the code flow"
 },{
   "user": anne.layfield@innovatorhub.com
   "jobId": 3000123412364
   "date": 2022-02-01
   "billableStatus": billable
   "hours": 05:00
 }]

 Threshold Limit:  30 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/addupdatetimelogs

Header

CopiedAuthorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxx9be93.9b8xxxxxxf

Success Response:

Copied{
    "response": {
        "result": {
            "addedTimelogIds": [3000123412389],
            "editedTimelogIds": [3000123412397],
            "errorLogs": [
                {
                    "errorCode": 9025,
                    "message": "Cannot log time for a completed job",
                    "user": anne.layfield@innovatorhub.com,
                    "date": 2022-02-01,
                    "jobId": 3000123412364,
                    "hours": 05:00
                }
           ],
          "message": "Data updated successfully",
          "uri": "/api/timetracker/addupdatetimelogs",
          "status": 0
    }
}