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
-
limitintegerThe page size in effect: the most records this page could hold.
-
next_cursorstring · nullableOpaque 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 whenhas_more_afteris false. -
prev_cursorstring · nullableOpaque 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_afterbooleanTrue when more records follow this page.
-
has_more_beforebooleanTrue when records come before this page. Always false on lists that page forward only.
{
"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
-
errorobjectShow 3 child attributesHide child attributes
-
codestringStable identifier for the failure, such as
record_not_found. Branch on this. -
messagestringEnglish description you can show to a person. May be reworded over time.
-
fieldsobjectPresent only when the failure is tied to particular fields. Keys are field names; see Field errors.
Show 2 child attributesHide child attributes
codestringA field code, such as
requiredorinvalid_format.messagestringWhat is wrong with this field.
-
{
"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
-
totalintegerThe number of matching records. When counting stopped at the cap, this equals
cap. -
exactbooleanTrue when
totalis the full count. False when more records match thancap. -
cappedbooleanTrue when counting stopped at
cap. Always the opposite ofexact. -
capinteger · nullableThe cap that applied. Null when you sent none, or sent zero or a negative number.
{
"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
-
okstringAlways
"ok".
{ "ok": "ok" }