Leave Transaction API

Modified on Fri, 26 Mar, 2021 at 11:17 AM

API Details

ParticularsDescription
API NameLeave Transaction
MethodPOST
URLhttps://portal.zinghr.com/2015/route/LMS/Employeeleavetransactions
Description
This API returns details of the employee’s leave applications and approver details
Input format
JSON
Output format
JSON



Input

Property NameData TypeDescriptionMandatoryRemarks
SubscriptionName
string
Subscription name of the account
Yes
Max length = 10 characters
TokenstringSecurity check. To verify the account and request
Yes
Actionfromdate
string
For shift details starting from the mentioned date
Date format: dd-mm-yyyy
Optional
Actiontodate
stringFor shift details till the mentioned date
Date format: dd-mm-yyyy
Optional

Leavetypecode
stringIf specified then API returns details for the leave type that is passed.
Optional

EmployeeCode
string
Returns leave summary for the specific employee. Only one employee code can be passed at a time
Optional
Actiontype
string
If specified then API returns details for only those leave types based on the Action value passed.
Possible values: Applied, Approved, Cancelled, Rejected
Optional



Response

Property NameData TypeDescription
MessagestringResponse message from the server
CodeintResponse code from the server
EmployeeLeaveTransactions
array
List of Employee Leave Transactions



Response Code and Message

CodeMessageRemarks
1Success
Successful API call
2
Employee not found
Employee code passed in parameter could not find an employee in the system
3Invalid Token
The token passed in the API did not match the token in the system. Validate the token from the Setup Circle in ZingHR portal
4Internal Server Error
The API execution faced an unexpected error
5Invalid date format
Use date format as dd-mm-yyyy
6Token expired
The token is expired and needs to be generated again. Token can be generated from the Setup Circle in ZingHR portal



Employee Leave Transactions


Property Name

Data Type

Description

EmployeeCode

string

Employee code of the employee as in the system

LeaveTypeCode

string

Leave type code of the leave in the system

LeaveTypeDesc

string

Leave type description as mentioned in the system

Applicationfromdate

string

Starting date of the leave as mentioned in leave application

Applicationtodate

string

End date of the leave as mentioned in leave application

StartDateShift

string

Shift start time in hh : mm

EndDateShift

string

Shift End time in hh : mm

Status

string

Leave status on today

Numberofdays

float

Number of days for which leave is applied

Reason

string

Reason for leave application

Remarks

string

Remarks as mentioned in leave application

Approver1code

string

Employee code of the first level approver for leave applications of the employee

Approver2code

string

Employee code of the second level approver for leave applications of the employee

Approver3code

string

Employee code of the third level approver for leave applications of the employee

Approver1Status 
string
Leave status given by Approver 1
Approver1Remarks
string
Remarks given by Approver 1
Approver1ActionDate
string
Captures Action date of leave taken by Approver 1
Approver2Status
string
Leave status given by Approver 1
Approver2Remarks
string
Remarks given by Approver 1
Approver2ActionDate
string
Captures Action date of leave taken by Approver 2
Approver3Status
string
Leave status given by Approver 1
Approver3Remarks
string
Remarks given by Approver 1
Approver3ActionDate
string
Captures Action date of leave taken by Approver 3





API Example :

Input Parameters: 

{

     "SubscriptionName": "product",

     "Token": "70dd7c2b0xxxxxx6aeb35a41f461a2ef",

     "EmployeeCode":"AK1002"

}

 

Response: 

 

{

     "Code": 1,

     "Message": "Success",

     "EmployeeLeaveTransactions": [

        {

            "EmployeeCode": "AK1002",

            "LeaveTypeCode": "PL",

            "LeaveTypeDescription": "Paid Leave",

            "Applicationfromdate": "18-03-2021",

            "Applicationtodate": "18-03-2021",

            "StartDateShift": "Full Day",

            "EndDateShift": "Full Day",

            "Status": "Final Acceptance",

            "Numberofdays": "1",

            "Remarks": "TEST",

            "Reason": "",

            "Approver1code": "admin",

            "Approver1Status": "Final Acceptance",

            "Approver1Remarks": "TEST",

            "Approver1ActionDate": "16-03-2021 12:00:00",

            "Approver2code": "dh10",

            "Approver2Status": "Final Acceptance",

            "Approver2Remarks": "",

            "Approver2ActionDate": "01-01-1900 12:00:00",

            "Approver3code": "",

            "Approver3Status": "Final Acceptance",

            "Approver3Remarks": "",

            "Approver3ActionDate": "01-01-1900 12:00:00"

        },

        {

            "EmployeeCode": "AK1002",

            "LeaveTypeCode": "SiL",

            "LeaveTypeDescription": "Sick Leave",

            "Applicationfromdate": "31-03-2021",

            "Applicationtodate": "01-04-2021",

            "StartDateShift": "Full Day",

            "EndDateShift": "Full Day",

            "Status": "Final Acceptance",

            "Numberofdays": "2",

            "Remarks": "Test reapply Newux",

            "Reason": "Outdoor",

            "Approver1code": "admin",

            "Approver1Status": "Final Acceptance",

            "Approver1Remarks": "Approve Admin",

            "Approver1ActionDate": "16-03-2021 12:00:00",

            "Approver2code": "dh02",

            "Approver2Status": "Final Acceptance",

            "Approver2Remarks": "Test Approve DH02",

            "Approver2ActionDate": "16-03-2021 12:00:00",

            "Approver3code": "ec410",

            "Approver3Status": "Final Acceptance",

            "Approver3Remarks": "Test Approve ec410",

            "Approver3ActionDate": "16-03-2021 12:00:00"

        },

        {

            "EmployeeCode": "AK1002",

            "LeaveTypeCode": "SiL",

            "LeaveTypeDescription": "Sick Leave",

            "Applicationfromdate": "31-03-2021",

            "Applicationtodate": "31-03-2021",

            "StartDateShift": "Full Day",

            "EndDateShift": "Full Day",

            "Status": "Cancelled",

            "Numberofdays": "1",

            "Remarks": "test cancel",

            "Reason": "Personal",

            "Approver1code": "Admin",

            "Approver1Status": "",

            "Approver1Remarks": "",

            "Approver1ActionDate": "",

            "Approver2code": "DH02",

            "Approver2Status": "",

            "Approver2Remarks": "",

            "Approver2ActionDate": "",

            "Approver3code": "EC410",

            "Approver3Status": "",

            "Approver3Remarks": "",

            "Approver3ActionDate": ""

        },

        {

            "EmployeeCode": "AK1002",

            "LeaveTypeCode": "PL",

            "LeaveTypeDescription": "Paid Leave",

            "Applicationfromdate": "17-03-2021",

            "Applicationtodate": "17-03-2021",

            "StartDateShift": "Full Day",

            "EndDateShift": "Full Day",

            "Status": "Final Acceptance",

            "Numberofdays": "1",

            "Remarks": "TEST",

            "Reason": "",

            "Approver1code": "admin",

            "Approver1Status": "Final Acceptance",

            "Approver1Remarks": "t",

            "Approver1ActionDate": "15-03-2021 12:00:00",

            "Approver2code": "dh10",

            "Approver2Status": "Final Acceptance",

            "Approver2Remarks": "",

             "Approver2ActionDate": "01-01-1900 12:00:00",

            "Approver3code": "",

            "Approver3Status": "Final Acceptance",

            "Approver3Remarks": "",

            "Approver3ActionDate": "01-01-1900 12:00:00"

        },

        {

             "EmployeeCode": "AK1002",

            "LeaveTypeCode": "PL",

            "LeaveTypeDescription": "Paid Leave",

            "Applicationfromdate": "09-03-2021",

            "Applicationtodate": "10-03-2021",

            "StartDateShift": "Full Day",

            "EndDateShift": "Full Day",

            "Status": "Final Acceptance",

            "Numberofdays": "2",

            "Remarks": "testing",

            "Reason": "Personal",

            "Approver1code": "admin",

            "Approver1Status": "Final Acceptance",

            "Approver1Remarks": "TEST",

            "Approver1ActionDate": "15-03-2021 12:00:00",

            "Approver2code": "dh10",

            "Approver2Status": "Final Acceptance",

            "Approver2Remarks": "",

            "Approver2ActionDate": "01-01-1900 12:00:00",

            "Approver3code": "",

            "Approver3Status": "Final Acceptance",

            "Approver3Remarks": "",

            "Approver3ActionDate": "01-01-1900 12:00:00"

        },

        {

            "EmployeeCode": "AK1002",

            "LeaveTypeCode": "PL",

            "LeaveTypeDescription": "Paid Leave",

            "Applicationfromdate": "10-02-2021",

            "Applicationtodate": "20-02-2021",

            "StartDateShift": "Full Day",

            "EndDateShift": "Full Day",

            "Status": "Final Acceptance",

            "Numberofdays": "11",

            "Remarks": "TEST",

            "Reason": "Personal",

            "Approver1code": "130abc",

            "Approver1Status": "Final Acceptance",

            "Approver1Remarks": "test",

            "Approver1ActionDate": "05-03-2021 12:00:00",

            "Approver2code": "dh10",

            "Approver2Status": "Final Acceptance",

            "Approver2Remarks": "",

            "Approver2ActionDate": "01-01-1900 12:00:00",

            "Approver3code": "",

            "Approver3Status": "Final Acceptance",

            "Approver3Remarks": "",

            "Approver3ActionDate": "01-01-1900 12:00:00"

         }

     ]

}


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article