Approve Timesheet API
This API is used to approve timesheet
Request URL:
https://people.zoho.com/people/api/timetracker/approvetimesheet?authtoken=<authtoken>×heetId=<timesheetId>&approvalStatus=<approvalStatus>&timeLogs=<timeLogs>&comments=<comments>&isAllLevelApprove=<isAllLevelApprove>
Header:
Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxx9be93.9b8xxxxxxf
Scope:
ZOHOPEOPLE.timetracker.ALL
OR
ZOHOPEOPLE.timetracker.UPDATE
Possible Operation Types:
ALL - Complete access to data
UPDATE - Only to modify data
Request parameter:
Parameter | Values Allowed | Default Value | Description |
*timesheetId | <Timesheet Id> | <Mandatory> | Specify the timesheet Id |
*approvalStatus | approved | rejected | <Mandatory> | Specify the approval status |
timeLogs | {<Timelog Id1>: <approved | rejected>,<Timelog Id2>: <approved | rejected>} | - | Specify the time logs of the timesheet along with the approval status in JSON format as shown. If this is not specified, all the time logs of the timesheet will either be approved or rejected based on the "approvalStatus" parameter. |
isAllLevelApprove | true | false | false | To approve the timesheet on behalf of all the approvers. |
comments | <Approval comments> | - | Specify the approval comments. |
Error Codes and Messages :
Error Code | Error Message |
9000 | Permission denied |
9005 | Time Tracker tab is disabled |
9008 | Timesheet not found |
9009 | Payment has already been processed for all time logs/timesheets until <pay period processing date>. Hence, you cannot perform this action |
9032 | Timesheet is either deleted or resubmitted. |
Success Response Format
{
"response": {
"result": {
"timesheetId": <Timesheet Id>
},
"message": <Message>,
"uri": "/api/timetracker/approvetimesheet",
"status": 0
}
}
Error Response Format
{
"response": {
"message": "Error in approving timesheet",
"uri": "/api/timetracker/approvetimesheet",
"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/approvetimesheet?approvalStatus=approved&timeLogs={"469505000000272225":"approved","469505000000272083":"rejected"}&comments=Partially Approved&isAllLevelApprove=false
Header
CopiedAuthorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxx9be93.9b8xxxxxxf
Sample Response
Copied{
"response": {
"result": {
"timesheetId": "469505000000271209"
},
"message": "Timesheet approved successfully",
"uri": "/api/timetracker/approvetimesheet",
"status": 0
}
}
Copied<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/timetracker/approvetimesheet">
<status>0</status>
<message>Timesheet approved successfully</message>
<result>
<timesheetId>469505000000271209</timesheetId>
</result>
</response>