General - Get balance for an account

API Url

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

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

Permissions: user

Path parameters

FieldTypeDescription
account_idString

Account ID.

Query parameters

FieldTypeDescription
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

      empNoString

Employee number.

      firstNameString

Employee first name.

      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"
}
}