General - Get attendance for all
API Url
Get daily attendance for all employees or a list of employees the user has access to. If you need data for a single employee, use /General/employees/{empNo}/attendances.
http://localhost:16010/ProMarkREST/rest/General/attendances
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 |
|---|---|---|
| date | Date | Get attendance for a specific date or interval - accepted value as date ISO-8601. If dates are not sent, then only TODAY is retreived. |
empIdsoptional | String | List of Employee ids (comma separated). |
| expand | String | Expand collection of data with absences, notes, breaks or allocation (tasks). "absences""notes""breaks""tasks" |
fieldsoptional | String | List of fields with comma delimiter to include in the response. In order to include fields from child objects use brackets. Example: To include just the empId, the day profile id, description use: fields=empId,shifts(id,description) |
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| to | Date | End time of unplanned interval as date-time ISO 8601. |
| attendances | Object[] | Collection with attendance data. |
absencesoptional | Object[] | Collection of absences for the entire day. |
| backColor | String | Background color of the absence reason as HEX. |
| code | String | Absence reason code. |
| date | Date | Absence date as ISO 8601. |
| description | String | Absence reason description. |
| foreColor | String | Text color of the absence reason as HEX. |
| from | Date | Absence start time as date-time ISO 8601. |
notesoptional | Object[] | Collection of absence notes. |
| id | Number | Unique identifier of the note. |
| text | String | Body of the note. |
selfServiceoptional | Object[] | Object that contains data related to SelfService |
| canDelete | Boolean | User can delete own request. |
| ownRequest | Boolean | true = It's a request initiated by you. |
| statusCode | Number | The status code of absence request (0: Vacant shift, 1: Waiting for manager, 2: Wating for employee, 3: Approved by employee, waiting for manager/approver, 4: Approved by employee, waiting for 2nd manager/approver, 5: Rejected by employee, 6: Rejected by manager/approver, 7: Approved by manager/approver, 8: Approved, 99: Request was deleted). |
| statusText | String | The status text of absence request. |
| type | Number | The type of SelfService (1: Swop, 2: Sell, 3: Absence). |
shortDescriptionoptional | String | Absence reason short description. |
| to | Date | Absence end time as date-time ISO 8601. |
| transSeq | Number | Absence unique id. |
| type | Number[1] | Absence type (1: All day absence). |
| attnProfDesc | String | Attendance profile description. |
| attnProfId | String | Attendance profile ID. |
avatarURIoptional | String | URI for loading employee avatar. If no picture exists, this will be skipped. |
| date | Date | Attendance date as ISO-8601. |
| empId | String | Employee identifier. |
empInfo1optional | String | Employee Info 1. |
empInfo2optional | String | Employee Info 2. |
empInfo3optional | String | Employee Info 3. |
empInfo4optional | String | Employee Info 4. |
empInfo5optional | String | Employee Info 5. |
| empInitials | String | Employee initials. |
| empName | String | Employee full name. |
| empNo | String | Employee number. |
notesoptional | Object[] | Collection of notes for the entire day. |
| id | Number | Unique identifier of the note. |
| text | String | Body of the note. |
primaryQualDescoptional | String | Employee primary qualification description. |
primaryQualIdoptional | String | Employee primary qualification id(if he has one). |
shiftsoptional | Object[] | If there are multiple shifts on the same day, there will be a collection of shifts. |
absencesoptional | Object[] | Collection of absences for the shift. |
| backColor | String | Background color of the absence reason as HEX. |
| code | String | Absence reason code. |
| date | Date | Absence date as ISO 8601. |
| description | String | Absence reason description. |
| foreColor | String | Text color of the absence reason as HEX. |
| from | Date | Absence start time as date-time ISO 8601. |
notesoptional | Object[] | Collection of absence notes. |
| id | Number | Unique identifier of the note. |
| text | String | Body of the note. |
| to | Date | Absence end time as date-time ISO 8601. |
| transSeq | Number | Absence unique id. |
| type | Number[2-5] | Absence type (2: Any time of shift, 3: Begining of shift, 4: End of shift, 5: All shift). |
arrivalFromoptional | Date | Allowed arrival start time for the shift as date-time ISO 8601. Used in connection with "arrival.to". |
| arrivalTime | Date | Arrival time for the shift as date-time ISO 8601. |
arrivalTooptional | Date | Allowed arrival end time for the shift as date-time ISO 8601. Used in connection with "arrival.from". |
| backColor | String | Background color of the day profile as HEX. |
breaksoptional | Object[] | Collection of breaks for the shift. |
| description | String | Break description = "Break". |
| from | Date | Break start as date-time ISO 8601. |
infooptional | String | Extra information for the break. |
| to | Date | Break end as date-time ISO 8601. |
| changedSchedule | Boolean | TRUE if normal schedule is changed for the shift. |
departureFromoptional | Date | Allowed departure start time for the shift as date-time ISO 8601. Used in connection with "departure.to". |
| departureTime | Date | Departure time for the shif as date-time ISO 8601. |
departureTooptional | Date | Allowed departure end time for the shift as date-time ISO 8601. Used in connection with "departure.from". |
| deptDesc | String | Employee department description on shift. |
| deptId | Object | Employee department identifier on shift. |
| description | String | Day profile description of shift. |
| foreColor | String | Text color of the day profile as HEX. |
| groupDesc | String | Employee group description on shift. |
| groupId | Object | Employee group identifier on shift. |
| id | String | Day profile ID of shift. |
normalTimeStartoptional | Date | Normal time start for the shift as date-time ISO 8601. |
normalTimeStopoptional | Date | Normal time stop for the shift as date-time ISO 8601. |
notesoptional | Object[] | Collection of notes for the specific shift. |
| id | Number | Unique identifier of the note. |
| text | String | Body of the note. |
selfServiceoptional | Object[] | Object that contains data related to SelfService |
| canDelete | Boolean | User can delete own request. |
| ownRequest | Boolean | true = It's a request initiated by you. |
| statusCode | Number | The status code of SelfService (0: Vacant shift, 1: Waiting for manager, 2: Wating for employee, 3: Approved by employee, waiting for manager/approver, 4: Approved by employee, waiting for 2nd manager/approver, 5: Rejected by employee, 6: Rejected by manager/approver, 7: Approved by manager/approver, 8: Approved, 99: Request was deleted). |
| statusText | String | The status text of SelfService. |
| type | Number | The type of SelfService (1: Swop, 2: Sell, 3: Absence). |
| shiftId | String | ID of shift. |
| shortDescription | String | Day profile short description of shift. |
tasksoptional | Object[] | Collection of allocated tasks for the shift. |
| description | String | Task description. |
| from | Date | Start time of task as date-time ISO 8601. |
| id | String | Task identifier. |
notesoptional | Object[] | Collection of notes for this task. |
| id | Number | Unique identifier of the note. |
| text | String | Body of the note. |
| to | Date | End time of task as date-time ISO 8601. |
unplannedoptional | Object[] | Collection of unplanned time intervals. |
| description | String | Unplanned interval description = "Un-planned". |
| from | Date | Start time of unplanned interval as date-time ISO 8601. |
| sortEmpNo | String | Sort employee number. |
| workingDay | Boolean | TRUE if day is a working (scheduled) day. |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "warning""info" |
Success example with a single shift:
HTTP/1.1 200 OK{"response": {"data": {"attendances": [{"empId": "414","empNo": "JHD","sortEmpNo": "!!!!!JHD","empName": "John Doe","empInitials": "JD","primaryQualId": "3","primaryQualDesc": "Line operator","empInfo1": "Mark information","empInfo3": "Lyngby","empInfo4": "Kopenhagen","empInfo5": "Denmark","avatarURI": "/rest/Resources/employees/833/avatar?eTag=722275891000","AttnProfId": "NF","attdProfDesc": "Fixed/Flex","date": "2017-02-13","workingDay": true,"shifts": [{"id": "SH1","description": "Morning shift","shortDescription": "NFM","backColor": "00FF40","foreColor": "000000","shiftId": "MORNING","normalTimeStart": "2017-07-13T07:00:00.000","arrivalTime": "2017-02-13T07:00:00.000","arrivalFrom": "2017-02-13T06:50:00.000","arrivalTo": "2017-02-13T07:05:00.000","normalTimeStop": "2017-02-13T15:00:00.000","departureTime": "2017-02-13T15:00:00.000","departureFrom": "2017-02-13T10:55:00.000","departureTo": "2017-02-13T11:05:00.000","changedSchedule": true,"deptId": "WLD1","deptDescription": "Welders","groupId": "","groupDesc": "","breaks": [{"description": "Break","from": "2017-02-13T09:15:00.000","to": "2017-02-13T09:30:00.000","info": "Fixed break"}]}]}]},"erorCode": 0,"errorMessage": ""}}
Success example with an all day absence, 2 normal shift and tasks:
HTTP/1.1 200 OK{"response": {"data": {"attendances": [{"empId": "414","empNo": "JHD","sortEmpNo": "!!!!!JHD","empName": "John Doe","empInitials": "JD","primaryQualId": "3","primaryQualDesc": "Line operator","empInfo1": "Mark information","empInfo3": "Lyngby","empInfo4": "Kopenhagen","empInfo5": "Denmark","avatarURI": "/rest/Resources/employees/833/avatar?eTag=722275891000","AttnProfId": "NF","attdProfDesc": "Fixed/Flex","date": "2017-02-13","workingDay": true,"absences": [{"transSeq": 12345678,"empId": "417","date": "2017-02-13","type": 1,"code": "H","description": "Holiday with pay","shortDescription": "H","backColor": "","foreColor": "","from": null,"to": null,"notes": [{"id": 2153496324,"text": "Holiday is agreed with shift manager."}]}],"shifts": [{"id": "SH1","description": "Morning shift","shortDescription": "NFM","backColor": "00FF40","foreColor": "000000","shiftId": "MORNING","normalTimeStart": "2017-07-02T08:00:00.000","arrivalTime": "2017-02-13T07:00:00.000","arrivalFrom": "2017-02-13T06:50:00.000","arrivalTo": "2017-02-13T07:05:00.000","normalTimeStop": "2017-07-02T16:00:00.000","departureTime": "2017-02-13T15:00:00.000","departureFrom": "2017-02-13T10:55:00.000","departureTo": "2017-02-13T11:05:00.000","changedSchedule": true,"deptId": "PRD1","deptDescription": "Production","groupId": "","groupDesc": "","breaks": [{"description": "Break","from": "2017-02-13T09:15:00.000","to": "2017-02-13T09:30:00.000","info": "Fixed break"}],"tasks": [{"empId": "417","date": "2017-02-10","id": "ORD14/O2","description": "Operation line 1","from": "2017-02-10T08:00:00.000","to": "2017-02-10T16:00:00.000","foreColor":"backColor":"notes": [{"id": 2153496053,"text": "Don't forget to setup the machine before working."}]}]},{"id": "SH2","description": "Afternoon shift","shortDescription": "NFM","backColor": "00FF40","foreColor": "000000","shiftId": "AFTER","normalTimeStart": "2018-02-13T08:00:00.000","arrivalTime": "2017-02-13T07:00:00.000","arrivalFrom": "2017-02-13T14:50:00.000","arrivalTo": "2017-02-13T15:05:00.000","normalTimeStop": "2017-02-13T16:00:00.000","departureTime": "2017-02-13T15:00:00.000","departureFrom": "2017-02-13T18:55:00.000","departureTo": "2017-02-13T19:05:00.000","changedSchedule": true,"deptId": "PRD1","deptDescription": "Production","groupId": "","groupDesc": "","breaks": [{"description": "Break","from": "2017-02-13T09:15:00.000","to": "2017-02-13T09:30:00.000","info": "Fixed break"},{"description": "Break","from": "2017-02-13T17:15:00.000","to": "2017-02-13T17:30:00.000","info": "Fixed break"}],"unplanned": [{"description": "Un-planned","from": "2017-02-13T07:00:00.000","to": "2017-02-13T15:00:00.000"}]}]}]},"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. |