This help guide will show you how to find the right entity and field in the HR API, including custom fields, manager details, leaving reasons and nationality.
Contents
- Introduction
- Check what your key can access
- Entities with different routes
- Where to find common fields
- ID fields and lookups
- Current and historical job data
- Custom fields
- Tips
Introduction
Data in the HR API is organised into entities (such as PersonDetail, AllJobPay and Absence), each with its own properties (fields). Most questions about "missing" data come down to one of three things: the data is held in a different entity, the field is an ID that needs looking up, or the entity or property has not been enabled on the API key.
Note: Values in angle brackets, such as <PerID>, are placeholders. IDs are unique to each system. For details on enabling entities and properties, please review the API Configuration guide. |
Check what your key can access
The quickest way to see what your key can do is the API Help page:
- Go to
https://<yoursystem>.ciphr.com/api/Help - Enter your API key on the Authentication tab and click Connect
- The Operations section then lists every entity, route and method (GET, POST, PUT, DELETE) available to that key, with the properties for each
If an entity does not appear, it is either not enabled on the key or none of its properties have been added. The error you receive tells you which:
| Response | Meaning | What to do |
|---|---|---|
Unauthorized access to API end node for GET method | The entity exists but Read Access is not switched on for the key | Enable Read Access on the entity in the key's Configuration view |
Unable to retrieve the data | The entity is enabled, but no properties have been added to it, or their access is switched off | Expand the entity, click Add to add its properties, then enable Read Access on each |
A web page saying The resource cannot be found (404) | The URL is not a valid route | Check the entity name and route (see Entities with different routes) |
| Note: Remember to click Update after adding properties or changing access. The help page and API only reflect saved changes. |
Entities with different routes
Most entities are called directly, for example /api/PersonDetail or /api/AllJobPay. A few are only available through a parent record, so calling them directly returns a 404:
| Entity | Incorrect | Correct route |
|---|---|---|
| JobPay | /api/JobPay | /api/PersonDetail/<PerID>/JobPay |
| CustomData | /api/CustomData | /api/CustomDataCategory/<CategoryID>/CustomData |
| JobCustomData | /api/JobCustomData | /api/JobCustomDataCategory/<CategoryID>/JobCustomData |
Some entities also support fewer methods than their access toggles suggest:
- PersonDetail supports GET and PUT only. New employee records can only be POST into the ATSApplicant entity which requires the Candidate Importer and configuration completed by Ciphr; create the employee in Ciphr HR first using the New Employee Wizard or importing through the Candidate Importer, then update them through the API.
- AllJobPay is read-only. To create or update job and pay records, use
/api/PersonDetail/<PerID>/JobPay.
Where to find common fields
| Data | Entity and properties | Notes |
|---|---|---|
| Employee's unique ID | PersonDetail ID | This is the PerID used by all other entities. Each post an employee holds has its own ID, with the same EmployeeNumber |
| Current job title, organisation units, location, grade, work pattern, salary | PersonDetail CurrentJobTitle, CurrentOrgUnit1Name to CurrentOrgUnit5Name, CurrentLocation, CurrentGrade, CurrentWorkpatternID, CurrentSalary and other Current… properties | Use the Current… properties rather than similarly named fields without the prefix, which may be blank. See Current and historical job data |
| Job and pay history, job changes and change reasons | AllJobPay, filtered by PerID | Includes descriptions such as ChangeReasonDescription, GradeDescription, OrgUnit1Name and WorkPatternDescription |
| Manager (the Reports To field under Employment Details on Personal Details) | PersonDetail ManagerName, ManagerID, ManagerEmployeeNumber, ManagerEmail, ManagerJobTitle, ManagerKnownAs | Driven by the employee's job and the job it reports into. ManagerID is the manager's PerID, and is 0 when there is no manager. ReportsToPerID is only populated if the jobs file is switched off in System Settings |
| Leaving date and reason | PersonDetail DateLeft, LeavingReasonID, LeavingNotes; LeavingReason Description, Category | Look up LeavingReasonID in the LeavingReason entity for the description |
| Nationality and Nationality 2 (Equal Opportunities tab) | PersonDetail CountryID, Country2ID; Country Description | Country Description holds the nationality (e.g. "British") and CountryName the country. PersonDetail Country returns the country name, not the nationality |
| Ethnic origin | PersonDetail EthnicOriginID, EthnicOriginCode, EthnicOriginDescription | Special category data (see note below) |
| Gender identity, gender reassignment, religion or belief, sexual orientation | PersonDetail GenderIdentity, GenderReassignment, ReligionOrBelief, SexualOrientation | Special category data (see note below) |
| Record group and payroll code | PersonDetail RecordGroupID, RecordGroupDescription, PayRollCodeDescription | |
| Further Information fields | Properties beginning CF on PersonDetail, JobPay and AllJobPay | See Custom fields |
| Additional Information (custom data categories) | CustomDataCategory, then CustomDataCategory/<CategoryID>/CustomData | See Custom fields |
| Note: Equal opportunities fields are special category personal data. Only enable these properties on keys that genuinely need them, restrict the IP Allow List, and make sure the receiving system is covered by your data protection arrangements. |
ID fields and lookups
Properties ending in ID hold the ID of a record in another entity. Where no matching description property is available, enable the lookup entity on the key and match the ID:
| Property | Lookup entity | Example |
|---|---|---|
LeavingReasonID | LeavingReason | GET /api/LeavingReason/<LeavingReasonID> |
CountryID, Country2ID | Country | GET /api/Country/<CountryID> |
WorkPatternID | WorkPattern | GET /api/WorkPattern/<WorkPatternID> |
OrgUnit1ID | OrganisationDetail | GET /api/OrganisationDetail/<OrgUnit1ID> |
ManagerID, PerID | PersonDetail | GET /api/PersonDetail/<PerID> |
Lookup entities usually contain a small, fixed list, so it is more efficient to retrieve the whole list once (for example GET /api/LeavingReason) and match IDs locally than to call the API for each employee.
Current and historical job data
| Source | What it returns | Use it for |
|---|---|---|
PersonDetail Current… properties | The job and pay record in effect today. CurrentJobPayID identifies which record | Current job details for each employee in a single call |
| AllJobPay | Every job and pay record for all employees, including past and future-dated changes, with descriptions | History, reporting, job changes and change reasons |
PersonDetail/<PerID>/JobPay | The same records as AllJobPay for one employee, with IDs only (no descriptions) | Creating or updating job and pay records |
Note: In AllJobPay, a blank DateTo marks the latest record, which may be a future-dated change that has not started yet. To find the record in effect on a given date, use the row where DateFrom is on or before that date and DateTo is blank or on or after it. |
Custom fields
Further Information fields
Further Information fields on Personal Details and Job & Pay appear in the API as properties beginning CF, followed by the field's label with spaces removed. For example, a field labelled Agency/Referral Name appears as CFAgency/ReferralName.
- In the key's Configuration view, these properties are listed under their internal names (for example
ClientFieldText1), not theCFname returned by the API. - Labels can include characters such as
/and(. These work in thefparameter as they are. When filtering on them, URL-encode the name, for exampleCFAgency%2FReferralName=[notnull]. - Give each Further Information field a unique label, so each
CFproperty name is unique.
Additional Information (custom data categories)
Additional Information categories (for example Children or Health and Safety Incidents) can hold several records per employee, so they have their own entities:
- List the categories and their IDs:
GET /api/CustomDataCategory - Get the records for a category:
GET /api/CustomDataCategory/<CategoryID>/CustomData
{"CustomData":[{"ID":<ID>,"PerID":<PerID>,"CatID":<CategoryID>,"Forenames":"Paul","Dateofbirth":"1995-07-01T00:00:00","Notes":null}]}Each record includes the employee's PerID, and its other properties are named after the category's field labels with spaces removed. Job-related categories work in the same way through JobCustomDataCategory and JobCustomData.
Tips
- Property names are not case-sensitive in filters and the
fparameter (surnameandSurnameboth work). - Use the
fparameter to return only the fields you need, for example/api/PersonDetail?f=ID,EmployeeNumber,ManagerName. A property that is not enabled is silently left out of the response. - Filtering on a property that is not enabled returns
400 Malformed query stringwithUnrecognised property. - Check the Help page with your key whenever you change the configuration, to confirm the entities, routes and methods available.
Footer
Comments
0 comments
Please sign in to leave a comment.