All at once
These lists have no pages, and answer with a bare array.GET /workspaces:
200
GET /posts/{id}/people is the one that puts its list in data, with nothing else:
200
Numbered pages, with links and meta
Send page (1 by default) and, on posts and media, per_page. per_page above 100 gives 100. On posts and media, a per_page or page below 1, or that isn’t a number, answers 422. Deliveries read such a page as page 1.
GET /posts?page=2&per_page=2, with 5 posts in all:
200
meta.last_pageis the last page, andmeta.totalthe number of items in all. On the last page,links.nextisnull.meta.linkshas one entry for each page button, for showing pages to people.linkskeep onlypage. They dropper_pageand every filter, such asworkspace_idorfolder_idon media. Build the next request yourself: the same query, withpageone higher.
Numbered pages, with pagination
Send page and per_page (1 to 100; above 100 answers 422).
GET /comments?post_id=1203&per_page=20:
200
has_more_pages is true. Comments come oldest first. Reviews come unanswered first, then newest, and their answer also has meta.unanswered: how many reviews have no reply.
A cursor
GET /posts/{id}/history gives up to 20 entries, newest first, and next:
200
next back as before: GET /posts/1203/history?before=98377. next is null on the last page.
Read every page
This reads every post, 100 at a time. It sends each page throughsend() from Rate limits, so a 429 waits and tries again. The same loop works for media, with any filters added to the query.
pagination.has_more_pages is false. For history, stop when next is null.
Each page is counted when you ask for it, so the list can move while you read. A post made or deleted during the read shifts the others: one can show up twice, which the loop keeps once, and one can be missed. For an exact copy, read every page again. Each page is one request toward your 60 a minute.
Related
Rate limits
60 requests a minute, and how to wait out a
429.Error handling
Every status and
error code, and when to try again.