This method returns a list of resources listed for your organization. Resources are documents like PDFS that you upload and make available to other employees via the Resources menu item.


Parameters

Your request data may contain the following parameters. GET or POST the object (as JSON) to https://api.kpaehs.com/v1/resources.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,
  "resources": [
    {
      "title": "HSE Management System",
      "created": 1476718840498,
      "sequence": 1,
      "category_id": "5804f0f80ef50473af58778e",
      "tags": [
        "health & safety"
      ],
      "shouldBeAvailableOffline": true,
      "versions": [
        {
          "creator_id": "5804f0f40ef50473af5870f5",
          "created": 1476718840498,
          "approvedOn": 1475077240497,
          "version": "3.2",
          "description": "This is a sample document.",
          "type": "file"
        }
      ],
      "id": "5804f0f80ef50473af587791"
    },
    {
      "title": "Workplace Principles and Policies",
      "created": 1476718840499,
      "sequence": 2,
      "category_id": "5804f0f80ef50473af58778e",
      "tags": [
        "health & safety"
      ],
      "shouldBeAvailableOffline": false,
      "versions": [
        {
          "creator_id": "5804f0f40ef50473af58719d",
          "created": 1476718840499,
          "approvedOn": 1465486840499,
          "version": "3.2",
          "description": "This is a sample document.",
          "type": "file"
        },
        {
          "creator_id": "5804f0f40ef50473af587128",
          "created": 1476718840499,
          "approvedOn": 1463499640499,
          "version": "1.2",
          "description": "This is a sample document.",
          "type": "file"
        },
        {
          "creator_id": "5804f0f40ef50473af58717c",
          "created": 1476718840499,
          "approvedOn": 1446655240499,
          "version": "1.1",
          "description": "This is a sample document.",
          "type": "file"
        }
      ],
      "id": "5804f0f80ef50473af587793"
    }
  ]
}

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.