Add Leave Balance API

To modify an employee's leave balance

Request URL:

https://people.zoho.com/api/leave/addBalance?balanceData=<balanceData>&dateFormat=<dateFormat> 

Header:

Authorization:Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf

Scope:

ZOHOPEOPLE.leave.ALL 

Request Parameters:

*balanceData
(Json string)
{
   "<EmpErecno>":
     {
        "<LeaveType ID>":
           {
             "date":"<Date>",
             "count":"<Balance>"
          },
          ...
      },
      ... 
}
dateFormat
(String)

Specify the date format

(Org date format will be considered if nothing is specified)

Note:

  • The above API will add/subtract the given count. 
  • Example:
    1)Existing balance is 20, if count = 4, new balance will be 24.
    2)Existing balance is 20, if count = -4, new balance will be 16.

     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.

    Request

    Copiedhttps://people.zoho.com/api/leave/addBalance?balanceData=<balanceData>&dateFormat=<dateFormat>

    Header

    CopiedAuthorization:Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf

    Response

    Copied{
        "response": {
            "result": {
                "addedCount": 20,
                "errorCount": 2
            },
            "message": "Data partially updated",
            "uri": "/api/leave/addBalance",
            "errors": {
                "500161005": {
                    "500042139": "Ensure date is in 'dd-MMM-yyyy' format for the parameter 'Date'"
                },
                "500169009": {
                    "500042112": "Leave type is not applicable for the employee"
                }
            },
            "status": 2
        }
    }