This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Leave in Zoho People
Overview
The following operations allow you to work with leaves. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with leaves, see Sample configuration.
Operation | Description |
---|---|
Adds a leave for an employee. | |
getLeaveTypes | Retrieves leave types. |
Operation details
This section provides further details on the operations related to leaves.
Adding a leave
The createLeave operation adds a leave for an employee.
<zohopeople.createLeave> <xmlData>{$ctx:xmlData}</xmlData> </zohopeople.createLeave>
Properties
The data to be used when creating the leave.xmlData:
Sample request
Following is a sample REST/JSON request that can be handled by the createLeave operation.
{ "apiUrl" : "https://people.zoho.com", "authToken" : "be5fd9396dbda44f2d3e026dabbe700a", "xmlData" : "<Request><Record><field name=\"Employee_ID\">281860000000054003</field><field name=\"From\">26-Sep-2014</field><field name=\"To\">27-Sep-2014</field><field name=\"Daystaken\">2</field><field name=\"Leavetype\">281860000000054059</field></Record></Request>", "responseType" : "application/json" }
Related Zoho People API documentation
https://www.zoho.com/people/help/api/leave-api.html#2
Retrieving leave types
The getLeaveTypes
operation retrieves the types of leaves.
<zohopeople.getLeaveTypes> <userId>{$ctx:userId}</userId> </zohopeople.getLeaveTypes>
Properties
Employee ID/Employee Mail ID/Record ID of the employee.userId:
Sample request
Following is a sample REST/JSON request that can be handled by the getLeaveTypes
operation.
{ "apiUrl" : "https://people.zoho.com", "authToken" : "462f5f36b8fb6c95e7b4d279894021b9", "userId":"1", "responseType" : "application/json" }
Related Zoho People API documentation
https://www.zoho.com/people/help/api/leave-api.html#3
Sample configuration
Following is a sample proxy service that illustrates how to connect to Zoho People with the init
operation and use the createLeave
operation. The sample request for this proxy can be found in createLeave sample request.
<?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="zohopeople_createLeave" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence onError="faultHandlerSeq"> <property name="apiUrl" expression="json-eval($.apiUrl)" /> <property name="authToken" expression="json-eval($.authToken)" /> <property name="xmlData" expression="json-eval($.xmlData)" /> <property name="responseType" expression="json-eval($.responseType)" /> <zohopeople.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <authToken>{$ctx:authToken}</authToken> <responseType>{$ctx:responseType}</responseType> </zohopeople.init> <zohopeople.createLeave> <xmlData>{$ctx:xmlData}</xmlData> </zohopeople.createLeave> <respond /> </inSequence> <outSequence> <send /> </outSequence> </target> <description /> </proxy>