Book Queries

Book list

This API retrieves a list of all <glossary:Book>s available to the current user. It returns the following two different response shapes depending on whether the limit parameter is supplied, select the schema and example that matches your use case:

  • Unpaginated: When limit is omitted, the response is a bare array of Book objects with no wrapper.
  • Paginated: When limit is supplied, the response is an object containing _links, limit, total_book_count, and books.

📘 Note > - By default results are ordered by <glossary:Book> PK in descending order but you can alter how and what books are returned by providing different parameters with your request. > - Use the name query parameter to find a <glossary:Book> by an exact name. This will be faster than search which uses approximate string matching algorithm.

get/v1/books

Request

  • Base URL
    https://api.ocrolus.com
  • URL
    https://api.ocrolus.com/v1/books
  • Auth
    OAuth 2
    Client credentials
    Token URL: https://auth.ocrolus.com/oauth/token

Query parameters

book_class'COMPLETE' | 'INSTANT' | 'INSTANT_CLASSIFY_ONLY' | 'INSTANT_CLASSIFY_ISO_CAPTURE'

Filter books by book class. If COMPLETE is among the values, books with no class set are also included.

limitinteger

Maximum number of Books to return per page. When omitted, the endpoint returns all matching Books as a bare JSON array with no pagination wrapper. When supplied, the response changes to a paginated object containing _links, limit, total_book_count, and books.

offsetinteger

Number of Books to skip before returning results. Use with limit to paginate through large collections. The list is index-based and starts at integer 0. An offset of 10 skips the first 10 results.

order'ASC' | 'DESC'

Sort direction for the results. DESC returns the newest Books first (default) whereas ASC returns the oldest first. By default, results are returned in descending order.

order_by'created' | 'name' | 'pk'

Field to sort the results by. Use created to sort by creation date, name to sort alphabetically, or pk to sort by Book ID.

namestring

Returns only the Book whose name matches this value exactly.

searchstring

Return Books whose names approximately match the search term.

xidstring
Example:sample-xid

Return only the Book whose external ID (xid) matches this value exactly.

Response

Success

OR

Example response

{
  "status": 200,
  "response": [
    {
      "pk": 26087155,
      "id": 26087155,
      "name": "Example Book 1",
      "created": "2022-11-28T18:24:02Z",
      "created_ts": "2022-11-28T18:24:02Z",
      "owner_email": "email@address.com",
      "is_public": true,
      "book_uuid": "b6e6b2f5-7d14-4580-9beb-5ec9b0d56e32",
      "book_type": "DEFAULT"
    }
  ],
  "message": "OK"
}

Changes

No recorded changes to this operation across all 1 revision of this API.