Managing API Keys

Managing API Keys

Menu Path : Setup > Common Setup > General Setup > API tab
Accessible to : Application Administrator

APIs are used to seamless communicate across different software. EazeWork HRMS provides the feature to create and manage multiple APIs in a secure manner. An API calls a "data-set" using a "service". The following data-sets are available -
1. EmpHRData - provides all the HR data linked to employee's profile, this data is present on My Profile page. Input string is
- API Key : Mandatory
- CorpURL : Mandatory : pass the URL of your instance
- EmpCode : employee code is optional, if entered the response will be only for on employee if not entered then response will be for all employees
- ActiveYN : This field is used to query Active vs Inactive employees, all resigned employees are categorized as Inactive, this is a mandatory field

2. EmpOfficialData - provides current value of employee's official details
- API Key : Mandatory
- CorpURL : Mandatory, pass the URL of your instance
- EmpCode : employee code is optional, if entered the response will be only for on employee if not entered then response will be for all employees
- ActiveYN : This field is used to query Active vs Inactive employees, all resigned employees are categorized as Inactive, this is a mandatory field

3. EmpLeaves - provides details of leaves taken in a given period. Input string is
- API Key : Mandatory
- CorpURL : Mandatory, pass the URL of your instance
- EmpCode : employee code is optional, if entered the response will be only for on employee if not entered then response will be for all employees
- ActiveYN : This field is used to query Active vs Inactive employees, all resigned employees are categorized as Inactive, this is a mandatory field
- DateFrom : The start date, mandatory field
- DateTo : The end date, mandatory field. Date range can be maximum 7 days. The date range is queried on Leave Start Date

4. EmpAttendance - provides details of attendance and shift timings for a day
- API Key : Mandatory
- CorpURL : Mandatory, pass the URL of your instance
- MarkDate : Mandatory, date for which attendance details are needed
- EmpCode : employee code is optional, if entered the response will be only for on employee if not entered then response will be for all employees

5. HolidayList - provides details of holidays and shift pattern in a calendar. Input string is
- API Key : Mandatory
- CorpURL : Mandatory, pass the URL of your instance
- Year : this is optional, if entered then data for requested year is given, if not entered then details for current year are given

6. HRExpSummary - summary of expense requests
- API Key : Mandatory
- CorpURL : Mandatory, pass the URL of your instance
- DateOption : Mandatory, you need to input the date for which you want to do the query, V (Voucher Date), F (Final Approval Date), P (Payment Date)
OnDate : Mandatory, you need to input the date for which you want to run the query in dd/mmm/yyyy format

7. HRAdvance -  summary of expense requests
- API Key : Mandatory
- CorpURL : Mandatory, pass the URL of your instance
- DateOption : Mandatory, you need to input the date for which you want to do the query, V (Voucher Date), F (Final Approval Date), P (Payment Date)
OnDate : Mandatory, you need to input the date for which you want to run the query in dd/mmm/yyyy format

8. EmpPrlData : provides payroll master data except salary related data. Input string is
- API Key : Mandatory
- CorpURL : Mandatory, pass the URL of your instance
- EmpCode : employee code is optional, if entered the response will be only for on employee if not entered then response will be for all employees- O
- ActiveYN : This field is used to query Active vs Inactive employees, all resigned employees are categorized as Inactive, this is a mandatory field

9. EmpSalaryDetails : provides salary breakup. Input string is
- API Key : Mandatory
- CorpURL : Mandatory,  pass the URL of your instance
- EmpCode : employee code is optional, if entered the response will be only for on employee if not entered then response will be for all employees
- ActiveYN : This field is used to query Active vs Inactive employees, all resigned employees are categorized as Inactive, this is a mandatory field

10. EmpSalarySlip :
- API Key : Mandatory
- CorpURL : Mandatory, pass the URL of your instance
- EmpCode : employee code is optional, if entered the response will be only for on employee if not entered then response will be for all employees
- Month : Mandatory, enter the month for which data is to be exported
- ActiveYN : This field is used to query Active vs Inactive employees, all resigned employees are categorized as Inactive, this is a mandatory field

11. EmpLoanDetails : provides details of loan / salary advance taken by the employee
- API Key : Mandatory
- CorpURL : Mandatory, pass the URL of your instance
- EmpCode : employee code is optional, if entered the response will be only for on employee if not entered then response will be for all employees
- ActiveYN : This field is used to query Active vs Inactive employees, all resigned employees are categorized as Inactive, this is a mandatory field

12. ResignedEmployees : provides details of resigned employees within a date range. Input string is
- API Key : Mandatory
- CorpURL : Mandatory, pass the URL of your instance
- EmpCode : employee code is optional, if entered the response will be only for on employee if not entered then response will be for all employees
- ActiveYN : This field is used to query Active vs Inactive employees, all resigned employees are categorized as Inactive, this is a mandatory field
- DateFrom : The start date, mandatory field
- DateTo : The end date, mandatory field. Date range can be maximum 7 days. The date range is queried on Last Working Day


From this tab you can do the following activities -
1. Combine different data sets to create your own custom API Key
2. Reset an existing API Key
3. Delete an existing API Key
4. Edit and make changes to an existing API

To create a new API key click on "Create New API" button and provide the details as shown below.


API Name : this is for your reference
Expiry Date : if you want to allow the usage of API for a fixed duration you can enter the expiry date
Data Set : select the data sets you want to use in the API

Error Codes

ResponseDescription
0No error
-1Invalid / expired API key
-2Invalid URL. Company URL is wrong, please use the URL which you use to login
-5Date From is missing
-6Date To is missing
-7Invalid date format. Correct date format is DD/MM/YYYY
-8Invalid date range, only 7 day period is allowed
-9Employee Code <code1, code2> does not exist in <active /inactive> employees
-10Date From should be less than or equal to Date To
-11Daily usage limit exceeded
-12
Enter value for Active Y/N
-13Invalid value for employee code

If the API call is returning an error code then it will not be counted in daily quota except a call which is returning error code -9.

Field Formats
Date will always be shown as dd/mm/yyyy : 05/02/2020 is 5th February 2020 and not 2nd May 2020
Month will always be shown as mmm-yyyy, for example May-2020
Year can be shown as YYYY or YYYY-YY depending on the way it is defined in the process