General - Get balance for all employees

API Url

Used to get all account balances for all employees user has access.

GET
http://localhost:16010/ProMarkREST/rest/General/account-balances

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
accountIdoptionalString

Optional list of Account IDs with comma separator.

periodTypeoptionalNumber[1-4]

Type of period (1: Latest closed period, 2: Oldest open period, 3: Current period 4: Current and future periods).

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

      accountsoptionalObject[]

Collection of accounts that belong to a given employee.

        balanceoptionalNumber

Balance value.

        departmentoptionalString

Department suffix.

        descriptionoptionalString

Account description.

        formatoptionalNumber

Account format (1: HH:MM, 4: HH.CC, 7: HH).

        groupoptionalString

Employee group.

        unitoptionalNumber

Account unit (1: Hours, 2: Days, 3: Pieces).

    employeesObject[]

Collection of employees with nested accounts

      avatarURIoptionalString

URI to the employee avatar.

      empNoString

Employee number.

      firstNameString

Employee first name.

      initialsString

Employee initials.

      sortEmpNoString

Sort employee number.

      surnameString

Employee surname.

  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": {
"employees": [
{
"empNo": "1",
"sortEmpNo": "!!!!!1",
"firstName": "John test",
"surname": "Doex Test"
},
{
"empNo": "2",
"sortEmpNo": "!!!!!2",
"firstName": "2",
"surname": "2",
"accounts": [
{
"id": "A001",
"department": "",
"group": "",
"balance": 86400,
"description": "Holidays",
"shortDescription": "Holiday"
"unit": 2,
"format": 1
},
{
"id": "T001",
"department": "",
"group": "",
"balance": 43200,
"description": "Normal hours",
"unit": 1,
"format": 1
},
{
"id": "T002A",
"department": "",
"group": "",
"balance": 81000,
"description": "Flex",
"unit": 1,
"format": 1
}
]
}
]
},
"errorCode": 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"
}
}