Pagination
Lists come in pages. Ask with limit and pass nextCursor along until it is null.
On this page
Parameters
GET lists that return one array accept these parameters:
| Parameter | Meaning |
|---|---|
limit | Page size, 1 to 200. Default: 100. |
cursor | Value of nextCursor from the previous response. |
The response contains nextCursor (null on the last page) and total.
Cursors are opaque: don't parse them, just pass them back.
curl "https://api.getprojectflow.com/v1/projects/PROJECT_ID/tasks?limit=50" \
-H "Authorization: Bearer pfat_YOUR_TOKEN"
# Next page: pass nextCursor from the response
curl "https://api.getprojectflow.com/v1/projects/PROJECT_ID/tasks?limit=50&cursor=eyJvIjo1MH0" \
-H "Authorization: Bearer pfat_YOUR_TOKEN"const tasks = [];
let cursor = null;
do {
const url = new URL('https://api.getprojectflow.com/v1/projects/PROJECT_ID/tasks');
url.searchParams.set('limit', '50');
if (cursor) url.searchParams.set('cursor', cursor);
const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.PROJECTFLOW_TOKEN}` },
});
const page = await res.json();
tasks.push(...page.tasks);
cursor = page.nextCursor;
} while (cursor);import os
import requests
tasks, cursor = [], None
while True:
params = {"limit": 50, **({"cursor": cursor} if cursor else {})}
page = requests.get(
"https://api.getprojectflow.com/v1/projects/PROJECT_ID/tasks",
headers={"Authorization": f"Bearer {os.environ['PROJECTFLOW_TOKEN']}"},
params=params,
).json()
tasks += page["tasks"]
cursor = page.get("nextCursor")
if not cursor:
breakstruct Page: Decodable {
let tasks: [Task]
let nextCursor: String?
}
var tasks: [Task] = []
var cursor: String?
repeat {
var url = URLComponents(string: "https://api.getprojectflow.com/v1/projects/PROJECT_ID/tasks")!
url.queryItems = [URLQueryItem(name: "limit", value: "50")]
if let cursor { url.queryItems?.append(URLQueryItem(name: "cursor", value: cursor)) }
var request = URLRequest(url: url.url!)
request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
let (data, _) = try await URLSession.shared.data(for: request)
let page = try JSONDecoder().decode(Page.self, from: data)
tasks += page.tasks
cursor = page.nextCursor
} while cursor != nil
Exception: external filter
The project list with the external filter pages itself: limit at most 100 (default 50), nextCursor, no total.