General - Get all employees
API Url
Used to get all employees.
http://localhost:16010/ProMarkREST/web/General/employees
Permissions: user
Request headers
| Field | Type | Description |
|---|---|---|
Accept-Languageoptional | String | =en-GB Language use for localization. |
X-Clientoptional | String | =Client type. "Portal""Mobile""Admin" |
X-Roleoptional | Number | ProMark role (1: Employee, 2: User). {12} |
X-WebPart-Idoptional | Number | Unique web-part identifier. |
Query parameters
| Field | Type | Description |
|---|---|---|
absenceTypeoptional | String | Absence type (1: All-day, 2: Anytime, 3: Before Clock-in, 4: After Clock-out, 5: All-shift). Only if expand='absences'. |
empIdoptional | String | Comma separated list of employee IDs. |
expandoptional | String | Expand employee info. "status""jobStatus""absences" |
fieldsoptional | String | Comma delimited list of fields to get. |
filteroptional | String | JSON containing filter fields, their values and conditions. |
fromoptional | Date | Start date for absences, Default: TODAY. |
noSchemaoptional | Boolean | true = The schema property/object will not be returned. Default is false. |
skipoptional | Number | Number of records to skip. Used for pagination. |
sortByoptional | String | String with fields to sort on (descending,ascending), where a descending sort is prefixed by minus: - |
statusTypeoptional | Number[1-6] | Attendance Type 1: All employees 2: Employees that has clocked in 3: Employees that hasn't clocked in but should have 4: Employees that hasn't clocked in 5: Employees that are absent 6: Registration missing. |
takeoptional | Number | Number of records to get. Used for pagination. |
tooptional | Date | End date for absences, Default : TODAY. |
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| employees | Object[] | Collection with employee data. |
absencesoptional | Object[] | Collection of absence intervals. |
approvalStatusoptional | Number | Approval status of the registration (0: No approval needed, 1: Pending approval, 2: Approved, 3: Rejected). |
| attendanceDate | Date | Attendance date of absence. |
backColoroptional | String | The reason background color. |
| code | String | The reason code (identifier). |
| description | String | The reason description. |
| empId | String | The employee ID. |
endTimeoptional | Number | End time of interval for category setup. |
foreColoroptional | String | The reason foreground color. |
hoursoptional | Number | The absence time expressed in seconds. It's not needed if reason code is set-up as being percent of normal time or star-end setup. |
| id | String | Unique identifier for the absence object. |
startTimeoptional | Number | Start time of interval for category setup. |
| type | Number | Absence type (1: All-day, 2: Anytime, 3: Before Clock-in, 4: After Clock-out, 5: All-shift). 1-5 |
address1optional | String | Address1 |
address2optional | String | Address2 |
address3optional | String | Address3 |
approvalDescoptional | String | Approval group description. |
approvalIdoptional | String | Approval group identifier. |
attendanceProfileDescoptional | String | Attendance profile description. |
attendanceProfileIdoptional | String | Attendance profile identifier. |
| avatarURI | String | Employee avatar. |
cardNooptional | String | Card number. |
categoryDescoptional | String | Category description. |
categoryIdoptional | String | Category identifier. |
cityoptional | String | City |
countryCodeoptional | String | Country Code |
| dateOfBirth | Date | Employee birthday. |
| dateOfEmp | Date | Date of employment. |
deptDescoptional | String | Employee actual department description. |
deptIdoptional | String | Employee actual department Id. |
divisionDescoptional | String | Division description. |
divisionIdoptional | String | Division identifier. |
emailoptional | String | Email address. |
email2optional | String | Email address 2 |
| empId | String | Employee Id. |
| empNo | String | Employee number. |
| firstName | String | Employee first name. |
firstRegoptional | date | First registration date |
genderoptional | String | Gender |
groupDescoptional | String | Employee actual group description. |
groupIdoptional | String | Employee actual group id. |
homeDeptDescoptional | String | Employee home department description. |
homeDeptIdoptional | String | Employee home department Id. |
homeGroupDescoptional | String | Employee home group description. |
homeGroupIdoptional | String | Employee home group id. |
homePhoneoptional | String | Home Phone. |
info1optional | String | Employee note1 |
info2optional | String | Employee note2 |
info3optional | String | Employee note3 |
info4optional | String | Employee note4 |
info5optional | String | Employee note5 |
| initials | String | Employee initials. |
jobDescriptionoptional | String | Job description. |
jobStatusoptional | Object[] | Job related status. |
| operationDesc | String | Operation description. |
| operationId | String | Operation Id. |
| orderDesc | String | Order description. |
| orderId | String | Order Id. |
managerIdoptional | String | Manager id |
managerNameoptional | String | Manager name |
| mobilePhone | String | Employee phone number. |
payrollDescoptional | String | Payroll profile description. |
payrollIdoptional | String | Payroll profile identifier. |
periodProfileDescoptional | String | Period profile description. |
periodProfileIdoptional | String | Period profile identifier. |
postalCodeoptional | String | Postal code |
provinceoptional | String | Province |
| sortNo | String | Sort number. |
| status | Number[0-11] | Employee status (0: Clock-in, 1: Clock-in late, 2: Clock-in early, 3:Clock-out early, 4: Missing clock-in, 5: Absent, 6: Non-scheduled day, 7: Clock-out early with absence, 8: Clock-in late with absence, 9: Not present, 10: Implicit clock-in, 11: Implicit clock-out). |
| statusInfo | String | Employee status info. |
| statusText | String | Employee status description. |
| surname | String | Employee last name. |
workPhoneoptional | String | work Phone. |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "warning""info" |
Success example without expand:
HTTP/1.1 200 OK{"response": {"data": {"employees": [{"empNo": "1","sortNo": "!!!!!!!!!1","firstName": "John test","surname": "Doex Test","initials": "DT","deptId": "01","deptDesc": "KEM ~\"Default~\"","groupId": "BH3","groupDesc": "3, Haslund Group 3","mobile": "99999","dateOfBirth": "1955-02-28","dateOfEmployment": "2006-10-01","email": "test@mark-info.com","avatarURI": "/rest/Resources/employees/414/avatar?eTag=721567206000"}]},"erorCode": 0,"errorMessage": ""}}
Success example with expand=status,jobStatus,absences,schema:
HTTP/1.1 200 OK{"response": {"data": {"employees": [{"empNo": "1","empId": "85","sortNo": "!!!!!!!!!1","firstName": "John test","surname": "Doex Test","initials": "DT","deptId": "SBI","deptDesc": "Department, Hudson Bay","groupId": "BH3","groupDesc": "3, Haslund Group 3","mobilePhone": "99999","dateOfBirth": "1955-02-28","dateOfEmp": "2006-10-01","emailAddr": "test@mark-info.com","status": 0,"statusInfo": "27/02/2012 12:28","statusText": "Present","jobDescription": "bbbb","jobStatus": [{"orderId": "010101","orderDesc": "Main order 1","operationId": "OOO1","operationDesc": "Painting"}],"absences": [{"id": "2153931200~\u00011~\u00010","attendanceDate": "2018-03-07","type": 1,"code": "02","description": "Reason-02","backColor": "808000","foreColor": "FFFF00","hours": 28800,"startTime": 28800,"endTime": 57600},{"id": "2153938630~\u00013~\u00010","attendanceDate": "2018-03-09","type": 3,"code": "HVBS","description": "Sickness","backColor": "FF0000","foreColor": "FFFF00","hours": 7200}]},{"empNo": "3","empId": "89","sortNo": "!!!!!!!!!3","firstName": "3","surname": "3","initials": "BHH","deptId": "BH","deptDesc": "Bo Haslund","groupId": "BH1","groupDesc": "1, Haslund Group 1","mobilePhone": "004577628898","dateOfBirth": "2006-07-01","dateOfEmp": "2006-06-02","emailAddr": "","status": 5,"statusInfo": "Doctor appointment","statusText": "Absent","avatarURI": "/rest/Resources/employees/414/avatar?eTag=721567206000"}],"schema": {"objectName": "employees","id": "empId","text": "firstName surname","fields": {"empNo": {"type": "string","title": "No."},"empId": {"type": "string","title": "ID"},"firstName": {"type": "string","title": "First name"},"surname": {"type": "string","title": "Surname"},"initials": {"type": "string","title": "Initials"}}}},"erorCode": 0,"errorMessage": ""}}
Error 4xx
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data (empty). |
| errorCode | Number | Error code. |
| errorMessage | String | Error description. |
Error example:
HTTP/1.1 404 Not found{"response": {"errorCode": 5,"errorMessage": "No employees"}}