Returns the completion percentage for an employee.

Results can be optionally filtered by a specific list of trainings or employees.

Due to the potential performance cost all results will be cached for 15 minutes.

To know when the results were last calculated refer to the last_updated value in the response.

Possible Status Values:

  • incomplete
  • expiring
  • active
  • unassigned


Parameters

Your request data may contain the following parameters. GET or POST the object (as JSON) to https://api.kpaehs.com/v1/training-employee-status.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.
training_ids number[] [1024] Optional Filters by the training id.
m_user_ids string[] ["625f865bdd51af8397e3d6b9"] Optional Filters by the user id.
limit number 1000 Optional The maximum number of responses to return. Max 1000. Defaults to 1000. Use page to fetch additional responses.
page number 1 Optional The page of responses to return. Defaults to 1. The response field paging.last_page tells you what the last valid page number is.
include_all_completions boolean false Optional By default, only required trainings are included in the "last_completed" field. A required training is one that has been assigned either directly or indirectly. Setting this to true will include all trainings with completions. This will add an additional field "is_required."

Example Request


Example Response

{
  "ok": true,
  "last_updated": 1564064128612,
  "employees": [
    {
      "status": "active",
      "m_user_id": "625f865bdd51af8397e3d6b9",
      "percent_complete": 100,
      "incomplete_training_ids": [],
      "complete_training_ids": [
        1030,
        1027,
        1026,
        1025,
        1024
      ],
      "last_completed": [
        {
          "id": 1030,
          "date_number": 20220506,
          "expiresOn": 20220715,
          "startsExpiringOn": 20220615
        },
        {
          "id": 1027,
          "date_number": 20210904,
          "expiresOn": null,
          "startsExpiringOn": null
        },
        {
          "id": 1026,
          "date_number": 20220406,
          "expiresOn": null,
          "startsExpiringOn": null
        },
        {
          "id": 1025,
          "date_number": 20220601,
          "expiresOn": null,
          "startsExpiringOn": null
        },
        {
          "id": 1024,
          "date_number": 20220308,
          "expiresOn": null,
          "startsExpiringOn": null
        }
      ]
    },
    {
      "status": "incomplete",
      "m_user_id": "525f8658dd51af8397e3d7bb",
      "percent_complete": 83,
      "incomplete_training_ids": [
        1027
      ],
      "complete_training_ids": [
        1030,
        1027,
        1026,
        1025,
        1024
      ],
      "last_completed": [
        {
          "id": 1030,
          "date_number": 20210506,
          "expiresOn": null,
          "startsExpiringOn": null
        },
        {
          "id": 1027,
          "date_number": 20210904,
          "expiresOn": null,
          "startsExpiringOn": null
        },
        {
          "id": 1026,
          "date_number": 20220406,
          "expiresOn": null,
          "startsExpiringOn": null
        },
        {
          "id": 1025,
          "date_number": 20220601,
          "expiresOn": null,
          "startsExpiringOn": null
        },
        {
          "id": 1024,
          "date_number": 20220308,
          "expiresOn": null,
          "startsExpiringOn": null
        }
      ]
    }
  ]
}

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.