Shared objects

A few small objects appear in responses from many resources. Each is described once here, and resource pages link to it.

#Page info

Returned as collection.page_info by every list that pages with a cursor. Cursor pagination explains how to use it.

Attributes

  • limitinteger

    The page size in effect: the most records this page could hold.

  • next_cursorstring · nullable

    Opaque token for the next page. Send it as next_cursor, with the same filters, sort, and order; it works only for the list that issued it. Null when has_more_after is false.

  • prev_cursorstring · nullable

    Opaque token for the previous page. Send it as prev_cursor. Only tasks and calendar events set it; on other lists it is null on every page.

  • has_more_afterboolean

    True when more records follow this page.

  • has_more_beforeboolean

    True when records come before this page. Always false on lists that page forward only.

Page info
{
  "limit": 50,
  "next_cursor": "c1Kq8ZrT4wVn2LmX7pYb3HdJ9sFe6Ga0Qu5Nt",
  "prev_cursor": null,
  "has_more_after": true,
  "has_more_before": false
}

#The error object

The body of every 4xx and 5xx response. Errors lists the codes and how to handle them.

Attributes

  • errorobject
    Show 3 child attributesHide child attributes
    • codestring

      Stable identifier for the failure, such as record_not_found. Branch on this.

    • messagestring

      English description you can show to a person. May be reworded over time.

    • fieldsobject

      Present only when the failure is tied to particular fields. Keys are field names; see Field errors.

      Show 2 child attributesHide child attributes
      • codestring

        A field code, such as required or invalid_format.

      • messagestring

        What is wrong with this field.

The error object
{
  "error": {
    "code": "invalid_request",
    "message": "Please provide the required parameters for this endpoint.",
    "fields": {
      "name": {
        "code": "required",
        "message": "Is missing"
      }
    }
  }
}

#The count object

Returned, wrapped in count, by the count endpoints of contacts, organizations, threads, files, tasks, calendar events, and notifications. Contacts, organizations, threads, and files take a cap parameter that stops counting early; the others always count exactly.

Attributes

  • totalinteger

    The number of matching records. When counting stopped at the cap, this equals cap.

  • exactboolean

    True when total is the full count. False when more records match than cap.

  • cappedboolean

    True when counting stopped at cap. Always the opposite of exact.

  • capinteger · nullable

    The cap that applied. Null when you sent none, or sent zero or a negative number.

The count object
{
  "count": {
    "total": 1000,
    "exact": false,
    "capped": true,
    "cap": 1000
  }
}

#The ok object

Returned by some operations that change something and have no record to return, such as pinning a record, marking a thread read, rejecting a duplicate, or removing a share. The status is 200. Other deletes return an empty response with status 204.

Attributes

  • okstring

    Always "ok".

The ok object
{ "ok": "ok" }