This method returns a list of equipment for the specified equipment type.

A status of uptodate, expiring, or expired will be returned for each equipment and for each of its inspection schedules. If any schedule is expired then the overall status will be expired.


Parameters

Your request data may contain the following parameters. GET or POST the object (as JSON) to https://api.kpaehs.com/v1/equipments.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.
equipmentType_id string "5804f0f80ef50473af587886" Required The equipment type id of the equipment to search for
service_type string "in" Optional Whether to include equipment which are out of service. By default, only in-service items will be fetched. in only fetches in-service items. out only fetches out-of-service items. all fetches both types.
columns string[] ["id","serialNumber","created","status","schedules"] Optional The column names that should be fetched. If no columns are provided then all columns will be returned.

Example Request


Example Response

{
  "ok": true,
  "equipments": [
    {
      "serialNumber": "EX-0001",
      "equipmentType_id": "5804f0f80ef50473af587886",
      "created": 1436121293577,
      "parent_id": "5804f0f40ef50473af589276",
      "fieldOffice_id": [
        "5804f0f40ef50473af5870d0"
      ],
      "lineOfBusiness_id": "5804f0f40ef50473af5870ee",
      "clients_id": [
        "5804f0f40ef50473af587736"
      ],
      "assignedUsers_id": [
        "5804f0f30ef50473af5870c6"
      ],
      "title": "Derrick's extinguisher",
      "notes": "Located by Derrick's desk in the south east corner of the Oklahoma City field office.",
      "isInService": true,
      "metavalues": {
        "kpgtlx6vhm19j8s2v5": 72,
        "9nfjv1z36oyynat4h4": "Red",
        "58078f96564894593b987364": {
          "item_ids": [
            93478
          ]
        }
      },
      "status": "expired",
      "schedules": [
        {
          "schedule_id": "5804f0f80ef50473af587888",
          "status": "expired",
          "expiresOn": 1459486800000,
          "expiringOn": 1458882000000,
          "lastCompletedOn": 1456898400000
        },
        {
          "schedule_id": "5804f0f80ef50473af587887",
          "status": "uptodate",
          "expiresOn": 1507006800000,
          "expiringOn": 1506402000000,
          "lastCompletedOn": 1475470800000
        }
      ],
      "id": "5804f0f80ef50473af587891"
    },
    {
      "serialNumber": "EX-0002",
      "equipmentType_id": "5804f0f80ef50473af587886",
      "created": 1420737816842,
      "parent_id": "5804f20f40ef50473af73536",
      "fieldOffice_id": [
        "5804f0f40ef50473af5870d0"
      ],
      "lineOfBusiness_id": "5804f0f40ef50473af5870ee",
      "assignedUsers_id": [
        "5804f0f30ef50473af5870c6"
      ],
      "notes": "Located by Derrick's desk in the south east corner of the Oklahoma City field office.",
      "isInService": true,
      "metavalues": {},
      "status": "uptodate",
      "schedules": [
        {
          "schedule_id": "5804f0f80ef50473af587888",
          "status": "uptodate",
          "expiresOn": 1478062800000,
          "expiringOn": 1477458000000,
          "lastCompletedOn": 1475470800000
        },
        {
          "schedule_id": "5804f0f80ef50473af587887",
          "status": "expired",
          "expiresOn": null,
          "expiringOn": null,
          "lastCompletedOn": null
        }
      ],
      "id": "5804f0f80ef50473af587892"
    }
  ]
}

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.