Job Schedule API

Purpose

These APIs are used to add, modify, get, publish and delete the job schedules.

Add Job Schedule API

This API is used to add job schedules.

Request URL:

https://people.zoho.com/api/timetracker/addJobSchedule?authtoken=<authtoken>&jobId=<jobId>&date=<date>&fromtime=<fromtime>&totime=<totime>&assignedTo=<assignedTo>&isPublish=<isPublish>

Request parameter:

ParameterValues AllowedDefault ValueDescription
*authtoken<authtoken><Mandatory>Specify the authentication token
*jobId<Job Id><Mandatory>Specify the Job Id
*date<date in yyyy-MM-dd/company date format><Mandatory>Specify the date when the job schedule needs to be added
*fromtime<fromtime in hh:mm a or HH:mm format><Mandatory>Specify the from time of the job schedule
*totime<totime in hh:mm a or HH:mm format><Mandatory>Specify the to time of job schedule
description<text> Specify the description of the job schedule
isPublish<true|false>falseSpecify if the job schedule needs to be published
assignedTo<ERECNO | Email-ID | Employee-ID><current user>Specify the user for whom the job schedule needs to be added
isRepeat<true|false>falseSpecify if the job schedule needs to be repeated
repeatInterval<1|2|3|4|5|6|7|8|9|10|11|12><Mandatory if isRepeat is true>Specify the interval for which the job schedule needs to be repeated
repeatType<daily|weekly|monthly><Mandatory if isRepeat is true>Specify how often the job schedule should be repeated based on the repeat interval
repeatUntil<date in yyyy -MM-dd/company date format><Mandatory if isRepeat is true>Specify the date until when the job schedule needs to be repeated
skipMaxLogHrsValidation<true|false>falseThis key will be considered only if maximum log hours restriction is enabled in the settings. Specify true if the scheduled hours can exceed the maximum log hours configured in the settings

Success Response Format :

{
    "response": {
        "result": [
            {
                "jobScheduleId": < added job schedule Id>

            }
        ],
        "message": "Data added successfully",
        "uri": "/api/timetracker/addJobSchedule",
        "status": 0
    }
}

Error Response Format :

{
    "response": {
        "message": Error in adding data,
        "uri": "/api/timetracker/addJobSchedule",
        "errors": [
            {
                "code": <Error Code>,
                "message": <Error Message>
            }
        ],
        "status": 1
    }
}

Error Codes and Messages :

Error CodeError Message
9000Permission denied
9002No <parameter_name> parameter specified
9004Wrong value given for <parameter_name> parameter
9012You cannot add/edit/publish/delete schedule of past dates.
9013This action cannot be completed as it overlaps with another schedule.
9014This action cannot be completed as it exceeds the maximum log hours allowed for this user.
9015This action cannot be completed as the user is not assigned to the job.

Example :

Request URL :

https://people.zoho.com/api/timetracker/addJobSchedule?authtoken=9f8d1b9722345dbec3a32asdhbcs23ad376319f6d234&jobId=111793034000627901&description= completeTestingfirst&isPublish=true&date=2019-08-01&fromtime=06:21&totime=07:32  

XML response:

<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/timetracker/addJobSchedule">
    <status>0</status>
    <message>Data added successfully</message>
    <result>
            <jobScheduleId>28000000202047</jobScheduleId>
    </result>        
</response>
 

JSON response:

{
    "response": {
        "result": [
            {
                "jobScheduleId": "28000000202047"
            }
        ],
        "message": "Data added successfully",
        "uri": "/api/timetracker/addJobSchedule",
        "status": 0
    }
}

Modify Job Schedule API

This API is used to modify the job schedules.

Request URL:

https://people.zoho.com/api/timetracker/editJobSchedule?authtoken=<authtoken>&jobScheduleId=<jobScheduleId>&fromtime=<fromtime>&totime=<totime>&description=<description>&isEditRepeat=<isEditRepeat>&isPublish=<isPublish>

Request parameter:

ParameterValues AllowedDefault ValueDescription
*authtoken<authtoken><Mandatory>Specify the authentication token
*jobScheduleId<jobScheduleId><Mandatory>Specify the job schedule id whose details needs to be modified
jobId<jobId><Existing job id>Specify the job id if the existing job needs to be modified
date<date in yyyy-MM-dd/company date format><Existing date>Specify the schedule date if the existing needs to be modified
fromtime<fromtime in hh:mm a or HH:mm format><Existing from time>Specify the from time if the existing needs to be modified
totime<totime in hh:mm a or HH:mm format><Existing to time>Specify the to time if the existing needs to be modified
description<text><Exisiting description>Specify the description if the existing needs to be modified
isRepeat<true|false>falseSpecify true to repeat this job schedule (if isRepeat is true, then isEditRepeat should not be set as the complete series will be created afresh)
repeatInterval<1|2|3|4|5|6|7|8|9|10|11|12><Mandatory if isRepeat is true>Specify the interval for which the job schedule needs to be repeated
repeatType<daily|weekly|monthly><Mandatory if isRepeat is true>Specify how often the job schedule should be repeated based on the repeat interval
repeatUntil<date in yyyy -MM-dd/company date format><Mandatory if isRepeat is true>Specify the date until when the job schedule needs to be repeated
isEditRepeat<true|false>falseSpecify this key only when the job schedule in the repeat series has to be edited. 
  • true - Changes will be applied to the repeat series based on editRepeatType
  • false - Only the mentioned schedule will be updated
editRepeatType< 1|2>1This will be considered only if isEditRepeat is true.
  • 1 - Changes will be applied to the current and the following schedules in the repeat series
  • 2 - Changes will be applied to all the schedules in the repeat series (Allowed only for admin/data admin)
isPublish< true|fasle>falseSpecify true if the job schedule needs to be published
skipMaxLogHrsValidation<true|false>falseThis key will be considered only if maximum log hours restriction is enabled in the settings. Specify true if the scheduled hours can exceed the maximum log hours configured in the settings

Success Response Format :

{
    "response": {
        "result": [
            {
                "jobScheduleId": <edited_job_schedule_id>
            }
        ],
        "message": " Data updated successfully",
        "uri": "/api/timetracker/editJobSchedule",
        "status": 0
    }
}

Error Response Format :

{
    "response": {
        "message": "Error in updating data",
        "uri": "/api/timetracker/editJobSchedule",
        "errors": [
            {
                "code": <Error Code>,
                "message": <Error Message>
            }
        ],
        "status": 1
    }
}

Error Codes and Messages :

Error CodeError Message
9000Permission denied
9002No <parameter_name> parameter specified
9004Wrong value given for <parameter_name> parameter
9012You cannot add/edit/publish/delete schedule of past dates.
9013This action cannot be completed as it overlaps with another schedule.
9014This action cannot be completed as it exceeds the maximum log hours allowed for this user..
9015This action cannot be completed as the user is not assigned to the job.

Example :

Request URL :

https://people.zoho.com/api/timetracker/editJobSchedule?authtoken=9f8d1b973c85dbec3a335ac976319f6d&jobScheduleId=28000000201263&isEditRepeat=true&
description=perform the job schedule on scheduled time

 

XML response:

<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/timetracker/editJobSchedule">
    <status>0</status>
    <message>Data updated successfully</message>
    <result>
        <jobScheduleId>28000000201263</jobScheduleId>
    </result>
</response>
 

JSON response:

{
    "response": {
        "result": [
            {
                "jobScheduleId": "28000000201263"
            }
        ],
        "message": "Data updated successfully",
        "uri": "/api/timetracker/editJobSchedule",
        "status": 0
    }
}

Get Job Schedule API

This API is used to get the list of job schedules of an employee.

Request URL:

https://people.zoho.com/api/timetracker/getJobSchedule?authtoken=<authtoken>&user=<user>&fromDate=<fromDate>&toDate=<toDate>&sIndex=<sIndex>&limit=<limit>

Request parameter:

ParameterValues AllowedDefault ValueDescription
*authtoken<authtoken><Mandatory>Specify the authentication token
user<ERECNO | Email-ID | Employee-ID | all><currentUser>Specify the user whose job schedule needs to be fetched
sIndex<sIndex>0Specify from which record the response should be fetched
limit<limit>200Specify the number of records to be fetched. Maximum value is 200
*fromDate<from date in yyyy-MM-dd/company date format><Mandatory>Specify the date from which the job schedule list needs to be fetched
*toDate<to date in yyyy-MM-dd/company date format><Mandatory>Specify the date till which the job schedule list needs to be fetched

Success Response Format :

{
   "response": {
      "result": {
         "usersList": [
            {
               "empId": < Employee_id>,
               "empName": < Employee_name>,
               "empErecno": < Employee_erecno>,
               "jobschArr": [
                  {
                     "date": < Schedule_date>,
                     "owner": < Owner_erecno>,
                     "jobName": < jobname>,
                     "jobId": < jobid>,
                     "fromtime_mins": < from time in mins>,
                     "totime_mins": < to time in mins>,
                     "color": < color_code(0-15)>,
                     "isPublished": < true|false>,
                     "description": < desc>,
                     "tschId": < job_schedule_id>,
                     "projectId": < project_id>,
                     "assignedTo": < assignee_erecno>
                     "repeatInt":< 1-12 >(NOTE: It denotes the interval in which the job schedule is repeated. This key exists only when the job schedule is in the repeat series.)
                     "repeatId":< repeat id>(NOTE: This key exists only when the job schedule is in the repeat series)
                     "repeatUntil":< repeat until date yyyy-mm-dd >(NOTE: It denotes the date until when the job schedule is repeated. This key exists only when the job schedule is in the repeat series.)
                     "repeatType":<0-2>(NOTE: It denotes how often the schedule is repeated (0- daily | 1- weekly | 2- monthly). This key exists only when the job schedule is in the repeat series.)
                  },...
               ]
            }
         ],
         "unpubcount": < unpublished_schedule_count>
      },
      "message": "Data fetched successfully",
      "uri": "/api/timetracker/getJobSchedule",
      "isNextAvailable": true, (NOTE: This key will not be available if there is no more data)
      "status": 0
   }
}

Error Response Format :

{
        "response": {
        "message": Error in fetching data,
        "uri": "/api/timetracker/getJobSchedule",
        "errors": [
            {
                "code": <Error Code>,
                "message": <Error Message>
            }
        ],
        "status": 1
    }
}

Error Codes and Messages :

Error CodeError Message
9000Permission denied
9002No <parameter_name> parameter specified
9004Wrong date format given for <parameter_name> parameter

Example :

Request URL :

https://people.zoho.com/api/timetracker/getJobSchedule ?authtoken=9f8d1b973c85dbec3a335ac976319f6d234&sIndex=0&limit=25&user=EID123&fromDate=2019-06-01&toDate=2019-06-30

 

XML response:

<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/timetracker/getJobSchedule">
    <status>0</status>
    <message>Data fetched successfully</message>
    <isNextAvailable>true</isNextAvailable>
    <result>
       <usersList>
            <empId>EID123</empId>
            <empName>Jeppiar J</empName>
            <empErecno>2801234000189001</empErecno>
            <jobschArr>
                 [{"2019-07-06": 
                        { "date": 2019-07-04 00:00:00.0,
                           "owner": 28000000189001,
                           "jobName": "CheckingPastPublishSeries",
                           "repeatId": "28000000201253",
                           "fromtime_mins": 732,
                           "color": "0",
                           "repeatInt": "1",
                           "isPublished": false,
                           "repeatType": "0",
                           "description": "", 
                           "tschId": "28000000201249",
                           "repeatUntil": "2019-07-09",
                           "assignedTo": "28000000189001",
                           "jobId": "28000000201237",
                           "totime_mins": 792,
                           "projectId": "28000000201239" }}]
            </jobschArr>
      </usersList>
      <unpubcount> 0 </unpubcount>
   </result>
</response>
 

JSON response:

{
    "response": {
        "result": {
            "usersList": [
                {
                    "empId": "1",
                    "empName": "Admin Joker",
                   "empErecno": "543031000000149005",
                    "jobschArr": [
                        {
                            "date": "2019-07-04 00:00:00.0",
                            "owner": "28000000189001",
                            "jobName": "CheckingPastPublishSeries",
                            "repeatId": "28000000201253",
                            "fromtime_mins": 732,
                            "color": "0",
                            "repeatInt": "1",
                            "isPublished": false,
                            "isException": false,
                            "repeatType": "0",
                            "description": "",
                            "tschId": "28000000201249",
                            "repeatUntil": "2019-07-09",
                            "assignedTo": "28000000189001",
                            "jobId": "28000000201237",
                            "totime_mins": 792,
                            "projectId": "28000000201239"
                        }
                    ],
                }
            ],
            "unpubcount": 0
        },
        "message": "Data fetched successfully",
        "uri": "/api/timetracker/getJobSchedule",
        "isNextAvailable": true,
        "status": 0
    }
}

Publish job schedule API

This API is used to publish the job schedules.

Request URL:

https://people.zoho.com/api/timetracker/publishJobSchedule?authtoken=<authtoken>&user=<user>&fromDate=<fromDate>&toDate=<toDate>

Request parameter:

ParameterValues AllowedDefault ValueDescription
*authtoken<authtoken><Mandatory>Specify the authentication token
user<ERECNO | Email-ID | Employee-ID | all><current user>Specify the user whose job schedules needs to be published.
*fromDate<from date in yyyy-MM-dd/company date format><Mandatory>Specify the date from which the job schedule needs to be published.
*todate<to date in yyyy-MM-dd/company date format><Mandatory>Specify the date till which the job schedule needs to be published.

Success Response Format :

{
    "response": {
        "message": "Job Schedules published successfully",
        "uri": "/api/timetracker/publishJobSchedule",
        "status": 0
    }
}

Error Response Format :

{
    "response": {
        "message": "Error in publishing job schedules",
        "uri": "/api/timetracker/publishJobSchedule",
        "errors": {
            "code": <Error Code>,
            "message": <Error Message>
        },
        "status": 1
    }
}

Error Codes and Messages :

Error CodeError Message
9001Error in publishing job schedules  
9000Permission denied
9002No <parameter_name> parameter specified
9004Wrong date format given for <parameter_name> parameter
9012You cannot add/edit/publish/delete schedule of past dates.

Example :

Request URL :

https://people.zoho.com/api/timetracker/publishJobSchedule?authtoken=9f8d1b973c85dbec3a335ac976319f6d234&user=EID123&fromDate=2019-07-04&toDate=2019-07-06

 

XML response:

<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/timetracker/publishJobSchedule">
    <status>0</status>
    <message>Job schedules published successfully</message>
</response>
 

JSON response:

{
    "response": {
        "message": "Job schedules published successfully",
        "uri": "/api/timetracker/publishJobSchedule",
        "status": 0
    }
}

Delete Job Schedule API

This API is used to delete the job schedule.

Request URL:

https://people.zoho.com/api/timetracker/deleteJobSchedule?authtoken=<authtoken>&jobScheduleId=<jobScheduleId>&isDeleteRepeat=<isDeleteRepeat>&delRepeatType=<delRepeatType>

Request parameter:

ParameterValues AllowedDefault ValueDescription
*authtoken<authtoken><Mandatory>Specify the authentication token
*jobScheduleId< jobScheduleId><Mandatory>Specify the job schedule id to be deleted
isDeleteRepeat<true|false>falseIf true, the repeat series will be deleted based on delRepeatType. If false, then only the mentioned schedule will be deleted
delRepeatType<1|2>1This will be considered only if isDeleteRepeat is true. 
  • 1 - Delete current and the following schedules in the repeat series
  • 2 - Delete all the schedules in the repeat series (allowed only for admin/data admin)

Success Response Format :

{
    "response": {
        "result": [
            {
                "jobScheduleId": <deleted job schedule id>
            }
        ],
        "message": "Data deleted successfully",
        "uri": "/api/timetracker/deleteJobSchedule",
        "status": 0
    }
}

Error Response Format :

{
    "response": {
        "message": "Error in deleting data",
        "uri": "/api/timetracker/deleteJobSchedule",
        "errors": [
            {
                "code": <Error Code>,
                "message": <Error Message>
            }
        ],
        "status": 1
    }
}

Error Codes and Messages :

Error CodeError Message
9000Permission denied
9002No <parameter_name> parameter specified
9012You cannot add/edit/publish/delete schedule of past dates.

Example :

Request URL :

https://people.zoho.com/api/timetracker/deleteJobSchedule?authtoken=9f8d1b973c85dbec3a335ac976319f6d234&jobScheduleId=28000000201195&
isDeleteRepeat=true&delRepeatType=2

 

XML response:

<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/timetracker/deleteJobSchedule">
    <status>0</status>
    <message>Data deleted successfully</message>
    <result>
        <jobScheduleId>469505000000271259</jobScheduleId>
    </result>
</response>
 

JSON response:

{
    "response": {
        "result": [
            {
                "jobScheduleId": "469505000000271259"
            }
        ],
        "message": "Data deleted successfully",
        "uri": "/api/timetracker/deleteJobSchedule",
        "status": 0
    }
}