Articles on: API

Employee API

The Employee API in XperienceHR enables seamless management of employee data through an external integration. It allows systems to retrieve, create, and update employee records within the platform, ensuring efficient HR data synchronization.

This API is particularly useful for organizations that need to automate employee data handling, such as onboarding new employees, updating roles, and managing workforce details in real time. It supports XML format for structured data exchange and requires authentication via an API key.

With the Employee API, businesses can integrate their HR systems with XperienceHR, improving efficiency and reducing manual data entry.

Overview



API Type: REST
Supported Formats: XML
API Key: Generated in the app configuration
Method: Get , Post


User Management



Get All Users



The Get All Users endpoint allows you to retrieve the full list of employees registered within the system.

Endpoint



Get Users Filtered by Parameters



ParameterTypeDescription
employeeLoginstringThe login of the employee.
firstNamestringThe first name of the employee.
lastNamestringThe last name of the employee.
activebooleanIndicates whether the employee is active.
userIdstringA unique, admin-modifiable ID of the employee (not the system generated ID).
cardIdstringThe card ID of the employee
positionstringThe employee’s position.
birthdaystringThe employee’s birthdate (format: yyyy-mm-dd).
workCalendarstringThe name of the employee’s work calendar
projectstringThe name of the project employee is assigned to
activitystringThe name of the activity
managerstringThe name of the employee’s manager.
organizationUnitstringThe name of the organization unit.
getSubOUEmployeebooleanWhen set to true, this retrieves employees from sub-organizational units. The default value is false.

Endpoint



Create New User



Parameter Min Max Required Information
User ID1100No
Login250Yes
ActiveFalseTrueNo
Position1100No
Organization Unit--NoValid XPHR value
Employee Group Code--NoValid XPHR value
Employee Group Name--NoValid XPHR value
Mobile AppFalseTrueNo
First Name149Yes
Last Name150Yes
State Code--NoValid XPHR value
State Name--NoValid XPHR value
Country Name--YesValid XPHR value
Birth DateCurrent Date - 100 yearsCurrent DateNoxml date & time format
Billing Rate--No
E-mail-150YesValid email address
Phone0100No
Card Number0255Must be unique
AttendanceFalseTrueNo
Time TrackingFalseTrueNo
Tracking Type16No
Default Project Code--NoValid XPHR value
Default Project Name--NoValid XPHR value
Default Activity Name--NoValid XPHR value
Cost UnitHourlyMonthlyNo
Cost Value--No
Work Calendar Code--Yes / NoValid XPHR value
Work Calendar Name--Yes / NoValid XPHR value
Work Calendar Start Date--Yes / No
Admin--No
Project Admin--No
HR AdminOrg. Unit Name-NoValid XPHR value
Line ManagerOrg. Unit Name-NoValid XPHR value
Project ManagerProject Name-NoValid XPHR value
Absence Type Code--NoValid XPHR value
Absence Type Name--NoValid XPHR value
Absence Limit Year--No
Absence Limit Value0-No
Cost Center Assignment - Code--NoValid XPHR value
Cost Center Assignment - Valid FromNoRequired when assigning a Cost Center


Date format: YYYY-MM-DD

Attendance Tracking Types: 1 = NFC, 2 = Clock In/Out, 3 = Interval, 4 - WiFi, 5 = NFC + Clock In/Out, 6 = NFC + Clock In/Out + Wifi

Work Calendar Code, Name, and Start Date are required when creating new employees. For updates, these values are not required.

API Input CodeRole Name
adminAdministrator
projectAdminProject Administrator
HrAdminHR Administrator
HrJuniorHR Manager
HrReadOnlyAssistant HR Manager
LineManagerLine Manager
ProjectManagerProject Manager
ProjectManagerJuniorAssistant Project Manager


Endpoint



Update User



This endpoint allows you to update the information of an existing employee.

Endpoint



Error Handling



Common errors help in debugging and correcting API usage issues.

Example 1: Invalid Work Calendar

Example 2: Missing Required Email Field

Example 3: Unknown Attendance Tracking Type


HTTP Response Codes


2XX Success - Operation completed successfully.
4XX Client Error - Likely an issue with the request, such as incorrect parameters or insufficient permissions. Returns an error message in text or XML format.
5XX Server Error - Indicates a server issue. Report this error if encountered.

Updated on: 16/02/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!