Getting employees
Retrieving employees from Deputy
Retrieving employee data from Deputy is likely going to be one of your key use cases for the Deputy API. Much of the functionality available within Deputy is linked to employees. Items such as rosters, timesheets and agreements are all related to employees and finding employee information is key to putting it all together.
You can retrieve employees in a bulk manner, as well as by individual id.
Retrieving employee data in bulk
URL
curl --request POST --url 'https://{install}.{geo}.deputy.com/api/v1/resource/Employee/QUERY'
This will return a payload containing multiple employee objects. Up to 500 can be returned in a single request.
The structure in the response is the same as the one seen below in the Retrieving employee data by Id section, only it will contain multiple records.
Retrieving individual employees by record id
The smoothest way to find employees details based on their id is using the Resource API. As part of the request, we include a parameter that contains the employee id instead of the word QUERY
URL
curl --request GET --url 'https://{install}.{geo}.deputy.com/api/v1/Resource/Employee/{id}
{
"Id": 1,
"Company": 1,
"FirstName": "John",
"LastName": "Doe",
"DisplayName": "John Doe",
"OtherName": null,
"Salutation": null,
"MainAddress": 195,
"PostalAddress": 195,
"Contact": 101184,
"EmergencyAddress": null,
"DateOfBirth": null,
"Gender": 0,
"Pronouns": 0,
"CustomPronouns": "",
"Photo": 931,
"UserId": 1,
"JobAppId": null,
"Active": true,
"StartDate": "2022-05-05T00:00:00+10:00",
"TerminationDate": null,
"StressProfile": 1,
"Position": null,
"HigherDuty": null,
"Role": 1,
"AllowAppraisal": true,
"HistoryId": 105907,
"CustomFieldData": null,
"Creator": 1,
"Created": "2022-05-05T16:42:21+10:00",
"Modified": "2022-07-29T11:55:56+10:00"
}
Data elements
Data Element | Info |
---|---|
Id | The id of this record |
Company | The integer of the primary location for the employee. This can be used with the Get location by id endpoint. |
FirstName | The first name of the employee |
LastName | The last name of the employee |
DisplayName | How the employees name is displayed in the Deputy UI |
OtherName | Any other name (eg middle name) entered against the employee |
Salutation | Any salutation entered against the employee |
MainAddress | Integer of the Address object associated with the employee. Can be used with the Address object in the Resource API |
PostalAddress | Integer of the Postal address object associated with the employee. Can be used with the Address object in the Resource API |
Contact | Integer of the Contact details related to the Contact Object in the Resource API |
EmergencyAddress | Integer of the emergency address object associated with the employee. Can be used with the Address object in the Resource API |
DateOfBirth | The date of birth entered for the employee |
Gender | Enums 0 - Prefer not to say 1 - Male 2 - Female 3 - Non-Binary |
Pronouns | Enums |
CustomPronouns | If the custom type is set for Pronouns, what the user has entered will appear as a string here |
Photo | Deputy internal use only |
UserId | The Userid for the employee |
JobAppId | Deputy internal use only |
Active | Boolean. Whether the employee is considered active or not in the Deputy install |
StartDate | The start date of the employee |
TerminationDate | If the employee is terminated the date that is set for it |
StressProfile | Enums |
Position | Job title entered against the employees profile |
HigherDuty | Deputy internal use only |
Role | Deputy internal use only |
AllowAppraisal | Only in Deputy Enterprise. Whether an employee can be appraised and rated. |
HistoryId | The id of the history object associated with the employee. Can be used with the EmployeeHistory object in the Resource API |
CustomFieldData | If there is any custom field data stored against the employee it will appear here |
Creator | The id of the employee that created the record |
Created | When the record was created |
Modified | When the record was last modified |
Updated 6 months ago