documents

Gets a list of documents

Changed on

Lists documents, search and filters allow fine grained lists to be generated.

Query parameters can be added to performed more fine grained filtering of the documents, these are handled by the DocumentsFilters class which defines the methods available
get/api/v1/documents

Request

Query parameters

includestring
Example:first_load

Includes child relationships in the response, format is comma separated. Check each model for the list of associated includes

indexstring
Example:user

Replaces the default response index from data to a user specific string

ie.

  ?index=new_index

response is wrapped

  {
    'new_index' : [
      .....  
    ]
  }
per_pageinteger
Example:20

The number of records to return for each request, default is 20

pageinteger
Example:1

The page number to return for this request (when performing pagination), default is 1

sortstring[]

Order the list by choosing a column and direction. Each value uses the form column|asc or column|desc.

Single sort — for example sort=created_at|desc.

Multiple sorts — for example
sort[]=id|desc&sort[]=created_at|asc.

Documents accept base table columns and any extra relationship sorts implemented in DocumentFilters. Unsupported keys are ignored.

[
  "created_at|desc"
]

Headers

X-API-TOKENstring required
Example:TOKEN

The API token to be used for authentication

X-Requested-Withstring required
Example:XMLHttpRequest

Used to send the XMLHttpRequest header

Response

A list of documents

Example response

{
  "data": [
    {
      "id": "AS3df3A",
      "name": "Beauty",
      "url": "Beauty",
      "preview": "Beauty",
      "type": "Beauty",
      "disk": "Beauty",
      "hash": "Beauty",
      "is_deleted": true,
      "is_default": true,
      "created_at": 134341234234,
      "updated_at": 134341234234,
      "deleted_at": 134341234234
    }
  ],
  "meta": {
    "pagination": {
      "total": 1,
      "count": 1,
      "per_page": 1,
      "current_page": 1,
      "total_pages": 1
    }
  }
}

Changes

    • info

      added the new optional query request parameter sort

    • info

      added the new optional query request parameter page

    • info

      added the new optional query request parameter per_page

    • info

      the response optional property // became read-only for the status