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.

GET
http://localhost:16010/ProMarkREST/rest/General/attendances

Permissions: user

Request headers

FieldTypeDescription
Accept-LanguageoptionalString

=en-GB Language use for localization.

X-ClientoptionalString

=Client type.

Allowed values:"Portal""Mobile""Admin"
X-RoleoptionalNumber

ProMark role (1: Employee, 2: User).

Allowed values:{12}
X-WebPart-IdoptionalNumber

Unique web-part identifier.

Query parameters

FieldTypeDescription
dateDate

Get attendance for a specific date or interval - accepted value as date ISO-8601. If dates are not sent, then only TODAY is retreived.

empIdsoptionalString

List of Employee ids (comma separated).

expandString

Expand collection of data with absences, notes, breaks or allocation (tasks).

Allowed values:"absences""notes""breaks""tasks"
fieldsoptionalString

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

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

          toDate

End time of unplanned interval as date-time ISO 8601.

    attendancesObject[]

Collection with attendance data.

      absencesoptionalObject[]

Collection of absences for the entire day.

        backColorString

Background color of the absence reason as HEX.

        codeString

Absence reason code.

        dateDate

Absence date as ISO 8601.

        descriptionString

Absence reason description.

        foreColorString

Text color of the absence reason as HEX.

        fromDate

Absence start time as date-time ISO 8601.

        notesoptionalObject[]

Collection of absence notes.

          idNumber

Unique identifier of the note.

          textString

Body of the note.

        selfServiceoptionalObject[]

Object that contains data related to SelfService

          canDeleteBoolean

User can delete own request.

          ownRequestBoolean

true = It's a request initiated by you.

          statusCodeNumber

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).

          statusTextString

The status text of absence request.

          typeNumber

The type of SelfService (1: Swop, 2: Sell, 3: Absence).

        shortDescriptionoptionalString

Absence reason short description.

        toDate

Absence end time as date-time ISO 8601.

        transSeqNumber

Absence unique id.

        typeNumber[1]

Absence type (1: All day absence).

      attnProfDescString

Attendance profile description.

      attnProfIdString

Attendance profile ID.

      avatarURIoptionalString

URI for loading employee avatar. If no picture exists, this will be skipped.

      dateDate

Attendance date as ISO-8601.

      empIdString

Employee identifier.

      empInfo1optionalString

Employee Info 1.

      empInfo2optionalString

Employee Info 2.

      empInfo3optionalString

Employee Info 3.

      empInfo4optionalString

Employee Info 4.

      empInfo5optionalString

Employee Info 5.

      empInitialsString

Employee initials.

      empNameString

Employee full name.

      empNoString

Employee number.

      notesoptionalObject[]

Collection of notes for the entire day.

        idNumber

Unique identifier of the note.

        textString

Body of the note.

      primaryQualDescoptionalString

Employee primary qualification description.

      primaryQualIdoptionalString

Employee primary qualification id(if he has one).

      shiftsoptionalObject[]

If there are multiple shifts on the same day, there will be a collection of shifts.

        absencesoptionalObject[]

Collection of absences for the shift.

          backColorString

Background color of the absence reason as HEX.

          codeString

Absence reason code.

          dateDate

Absence date as ISO 8601.

          descriptionString

Absence reason description.

          foreColorString

Text color of the absence reason as HEX.

          fromDate

Absence start time as date-time ISO 8601.

          notesoptionalObject[]

Collection of absence notes.

            idNumber

Unique identifier of the note.

            textString

Body of the note.

          toDate

Absence end time as date-time ISO 8601.

          transSeqNumber

Absence unique id.

          typeNumber[2-5]

Absence type (2: Any time of shift, 3: Begining of shift, 4: End of shift, 5: All shift).

        arrivalFromoptionalDate

Allowed arrival start time for the shift as date-time ISO 8601. Used in connection with "arrival.to".

        arrivalTimeDate

Arrival time for the shift as date-time ISO 8601.

        arrivalTooptionalDate

Allowed arrival end time for the shift as date-time ISO 8601. Used in connection with "arrival.from".

        backColorString

Background color of the day profile as HEX.

        breaksoptionalObject[]

Collection of breaks for the shift.

          descriptionString

Break description = "Break".

          fromDate

Break start as date-time ISO 8601.

          infooptionalString

Extra information for the break.

          toDate

Break end as date-time ISO 8601.

        changedScheduleBoolean

TRUE if normal schedule is changed for the shift.

        departureFromoptionalDate

Allowed departure start time for the shift as date-time ISO 8601. Used in connection with "departure.to".

        departureTimeDate

Departure time for the shif as date-time ISO 8601.

        departureTooptionalDate

Allowed departure end time for the shift as date-time ISO 8601. Used in connection with "departure.from".

        deptDescString

Employee department description on shift.

        deptIdObject

Employee department identifier on shift.

        descriptionString

Day profile description of shift.

        foreColorString

Text color of the day profile as HEX.

        groupDescString

Employee group description on shift.

        groupIdObject

Employee group identifier on shift.

        idString

Day profile ID of shift.

        normalTimeStartoptionalDate

Normal time start for the shift as date-time ISO 8601.

        normalTimeStopoptionalDate

Normal time stop for the shift as date-time ISO 8601.

        notesoptionalObject[]

Collection of notes for the specific shift.

          idNumber

Unique identifier of the note.

          textString

Body of the note.

        selfServiceoptionalObject[]

Object that contains data related to SelfService

          canDeleteBoolean

User can delete own request.

          ownRequestBoolean

true = It's a request initiated by you.

          statusCodeNumber

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).

          statusTextString

The status text of SelfService.

          typeNumber

The type of SelfService (1: Swop, 2: Sell, 3: Absence).

        shiftIdString

ID of shift.

        shortDescriptionString

Day profile short description of shift.

        tasksoptionalObject[]

Collection of allocated tasks for the shift.

          descriptionString

Task description.

          fromDate

Start time of task as date-time ISO 8601.

          idString

Task identifier.

          notesoptionalObject[]

Collection of notes for this task.

            idNumber

Unique identifier of the note.

            textString

Body of the note.

          toDate

End time of task as date-time ISO 8601.

        unplannedoptionalObject[]

Collection of unplanned time intervals.

          descriptionString

Unplanned interval description = "Un-planned".

          fromDate

Start time of unplanned interval as date-time ISO 8601.

      sortEmpNoString

Sort employee number.

      workingDayBoolean

TRUE if day is a working (scheduled) day.

  messageoptionalObject

Object containing response messages.

    codeNumber

Message code.

    textString

Message text.

    typeString

Type of message.

Allowed values:"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

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data (empty).

  errorCodeNumber

Error code.

  errorMessageString

Error description.