Skip to main content

Count

Count works or individual objects using ContexQL query.

info

Available in Contextal Platform 1.0 and later.

Request

  • Path: /api/v1/count
  • Verb: GET
    • URL parameters:
      • q: the ContexQL query string
      • getobjects: requests the query to return count of objects rather than works (optional, default false)
  • Verb: POST or PUT
    • Content-Type: application/json
    • Body: JSON object with the same content as the URL parameters above

Reply

On success:

  • Status: 200 - Ok
  • Content-Type: application/json
  • Body: A JSON object containing the matching items count

On failure:

  • Status: 400
    • Content-type: text/plain
note

This indicates an error in the HTTP request e.g. wrong content-type, broken json, etc.

  • Content-type: application/json
note

This indicates either a compile time or runtime error; the kind key of the object in the body will clarify what the problem was.

  • Status: 5xx

    Platform is in trouble, try again later.