This method returns a list of employees for your company.


Parameters

Your request data may contain the following parameters. GET or POST the object (as JSON) to https://api.kpaehs.com/v1/users.list.

Parameter TypeScript Example Required Description
token string "YOUR_TOKEN" Required Your API Token
pretty boolean true Optional true means the response json will include white space for readability. Default is false.

Example Request


Example Response

{
  "ok": true,
  "users": [
    {
      "created": 1476718836355,
      "registered_on": 1476718836602,
      "hse_id": "5804f0f40ef50473af587116",
      "manager_id": "5804f0f40ef50473af59375b",
      "fieldOffice_id": [
        "5804f0f40ef50473af5870d0"
      ],
      "lineOfBusiness_id": [
        "5804f0f40ef50473af5870d2"
      ],
      "clients_id": [
        "5804f0f40ef50473af588730",
        "5804f0f40ef50473af738640"
      ],
      "firstname": "Derrick",
      "lastname": "Brown",
      "employeeNumber": "DBROWN",
      "email": "dbrown.acme@example.com",
      "username": "dbrown",
      "hireDate": 1476718836357,
      "role_id": "5804f0f30ef50473af5870ca",
      "id": "5804f0f30ef50473af5870c6",
      "metavalues": {
        "6s9dfinqcqmowmbhk0": [
          "1029"
        ]
      },
      "lastWebAccess": 1605904630000,
      "lastMobileAccess": 1605904530000
    },
    {
      "created": 1470325236552,
      "hse_id": "5804f0f40ef50473af587185",
      "manager_id": "5804f0f40ef50473af59375b",
      "fieldOffice_id": [
        "5804f0f40ef50473af5870ce"
      ],
      "clients_id": [],
      "lineOfBusiness_id": [
        "5804f0f40ef50473af5870d2"
      ],
      "firstname": "David",
      "lastname": "Ball",
      "employeeNumber": "DAVI2345",
      "email": "dball.acme@example.com",
      "username": "dball",
      "jobTitle_id": "5804f0f40ef50473af5870d7",
      "cellPhone": "(555) 555-5555",
      "hireDate": 1345525200000,
      "emergencyContact": "Spouse: (405) 555-1234\nBrother: (918) 555-1234",
      "isDriver": true,
      "role_id": "5804f0f30ef50473af5870ca",
      "id": "5804f0f40ef50473af5870e6",
      "metavalues": {
        "6s9dfinqcqmowmbhk0": [
          "1029"
        ]
      },
      "lastWebAccess": 1605904630000,
      "lastMobileAccess": 1605904530000
    },
    {
      "created": 1474990836553,
      "terminationDate": 1475000836553,
      "hse_id": "5804f0f40ef50473af58712b",
      "manager_id": "5804f0f40ef50473af59375b",
      "fieldOffice_id": [
        "5804f0f40ef50473af5870d0"
      ],
      "clients_id": [
        "5804f0f40ef50473af588730"
      ],
      "lineOfBusiness_id": [
        "5804f0f40ef50473af5870d3"
      ],
      "firstname": "John",
      "lastname": "Smith",
      "employeeNumber": "13374",
      "email": "john.acme@example.com",
      "username": "john",
      "jobTitle_id": "5804f0f40ef50473af5870d8",
      "cellPhone": "(405) 555-1234",
      "hireDate": 1395291600000,
      "emergencyContact": "Spouse: (405) 555-1234\nBrother: (918) 555-1234",
      "isDriver": true,
      "role_id": "5804f0f30ef50473af5870c8",
      "id": "5804f0f40ef50473af5870e9",
      "metavalues": {
        "6s9dfinqcqmowmbhk0": [
          "1028"
        ]
      },
      "lastWebAccess": 1605904630000,
      "lastMobileAccess": 1605904530000
    }
  ],
  "columns": [
    "cellPhone",
    "clients_id",
    "created",
    "creator_id",
    "email",
    "emergencyContact",
    "employeeNumber",
    "firstname",
    "hireDate",
    "hse_id",
    "id",
    "isDriver",
    "isRegulatedDriver",
    "jobTitle_id",
    "lastMobileAccess",
    "lastWebAccess",
    "lastname",
    "manager_id",
    "mentor_id",
    "metavalues",
    "registered_on",
    "role_id",
    "sseDate",
    "supervisor_id",
    "terminationDate",
    "username"
  ]
}

Errors

If an error occurs, the response JSON will have ok set to false:

{
  "ok": false,
  "error": "token_invalid",
  "description": "The token `YOUR_TOKEN` was not found."
}

The error field will contain one of the following error identifiers and there may also be a description field with a more detailed explanation:

Identifier Description
api_method_not_found The requested url did not match any KPA Flex API method.
request_method_invalid The requested method was not GET or POST.
request_data_invalid The request did not include a valid JSON request object.
rate_limit_exceeded This token is exceeding its request limit.
token_missing The request did not include a token.
token_invalid The request token was invalid.
token_inactive The request token was has been deactivated.
token_permission The request token does not have write permission.
account_inactive The request token was for an account that is not active.
parameter_unexpected The request data included a parameter that is not supported.
parameter_missing The request data failed to include a parameter which was required.
parameter_invalid The request data included a parameter which had a value that is not allowed.
server_error The server encountered an internal error.
content_not_found The requested content was not found.