General - Get all employees

API Url

Used to get all employees.

GET
http://localhost:16010/ProMarkREST/web/General/employees

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
absenceTypeoptionalString

Absence type (1: All-day, 2: Anytime, 3: Before Clock-in, 4: After Clock-out, 5: All-shift). Only if expand='absences'.

empIdoptionalString

Comma separated list of employee IDs.

expandoptionalString

Expand employee info.

Allowed values:"status""jobStatus""absences"
fieldsoptionalString

Comma delimited list of fields to get.

filteroptionalString

JSON containing filter fields, their values and conditions.

fromoptionalDate

Start date for absences, Default: TODAY.

noSchemaoptionalBoolean

true = The schema property/object will not be returned. Default is false.

skipoptionalNumber

Number of records to skip. Used for pagination.

sortByoptionalString

String with fields to sort on (descending,ascending), where a descending sort is prefixed by minus: -

statusTypeoptionalNumber[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.

takeoptionalNumber

Number of records to get. Used for pagination.

tooptionalDate

End date for absences, Default : TODAY.

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    employeesObject[]

Collection with employee data.

      absencesoptionalObject[]

Collection of absence intervals.

        approvalStatusoptionalNumber

Approval status of the registration (0: No approval needed, 1: Pending approval, 2: Approved, 3: Rejected).

        attendanceDateDate

Attendance date of absence.

        backColoroptionalString

The reason background color.

        codeString

The reason code (identifier).

        descriptionString

The reason description.

        empIdString

The employee ID.

        endTimeoptionalNumber

End time of interval for category setup.

        foreColoroptionalString

The reason foreground color.

        hoursoptionalNumber

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.

        idString

Unique identifier for the absence object.

        startTimeoptionalNumber

Start time of interval for category setup.

        typeNumber

Absence type (1: All-day, 2: Anytime, 3: Before Clock-in, 4: After Clock-out, 5: All-shift).

Size range: 1-5
      address1optionalString

Address1

      address2optionalString

Address2

      address3optionalString

Address3

      approvalDescoptionalString

Approval group description.

      approvalIdoptionalString

Approval group identifier.

      attendanceProfileDescoptionalString

Attendance profile description.

      attendanceProfileIdoptionalString

Attendance profile identifier.

      avatarURIString

Employee avatar.

      cardNooptionalString

Card number.

      categoryDescoptionalString

Category description.

      categoryIdoptionalString

Category identifier.

      cityoptionalString

City

      countryCodeoptionalString

Country Code

      dateOfBirthDate

Employee birthday.

      dateOfEmpDate

Date of employment.

      deptDescoptionalString

Employee actual department description.

      deptIdoptionalString

Employee actual department Id.

      divisionDescoptionalString

Division description.

      divisionIdoptionalString

Division identifier.

      emailoptionalString

Email address.

      email2optionalString

Email address 2

      empIdString

Employee Id.

      empNoString

Employee number.

      firstNameString

Employee first name.

      firstRegoptionaldate

First registration date

      genderoptionalString

Gender

      groupDescoptionalString

Employee actual group description.

      groupIdoptionalString

Employee actual group id.

      homeDeptDescoptionalString

Employee home department description.

      homeDeptIdoptionalString

Employee home department Id.

      homeGroupDescoptionalString

Employee home group description.

      homeGroupIdoptionalString

Employee home group id.

      homePhoneoptionalString

Home Phone.

      info1optionalString

Employee note1

      info2optionalString

Employee note2

      info3optionalString

Employee note3

      info4optionalString

Employee note4

      info5optionalString

Employee note5

      initialsString

Employee initials.

      jobDescriptionoptionalString

Job description.

      jobStatusoptionalObject[]

Job related status.

        operationDescString

Operation description.

        operationIdString

Operation Id.

        orderDescString

Order description.

        orderIdString

Order Id.

      managerIdoptionalString

Manager id

      managerNameoptionalString

Manager name

      mobilePhoneString

Employee phone number.

      payrollDescoptionalString

Payroll profile description.

      payrollIdoptionalString

Payroll profile identifier.

      periodProfileDescoptionalString

Period profile description.

      periodProfileIdoptionalString

Period profile identifier.

      postalCodeoptionalString

Postal code

      provinceoptionalString

Province

      sortNoString

Sort number.

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

      statusInfoString

Employee status info.

      statusTextString

Employee status description.

      surnameString

Employee last name.

      workPhoneoptionalString

work Phone.

  messageoptionalObject

Object containing response messages.

    codeNumber

Message code.

    textString

Message text.

    typeString

Type of message.

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

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data (empty).

  errorCodeNumber

Error code.

  errorMessageString

Error description.

Error example:

HTTP/1.1 404 Not found
{
"response": {
"errorCode": 5,
"errorMessage": "No employees"
}
}