工作原理
| Parameter | Type | Description |
|---|---|---|
first | integer | 每页返回的最大项目数(默认值因接口而异) |
after | string | 上一个响应返回的不透明游标。获取第一页时省略该参数 |
响应格式
| 字段 | 说明 |
|---|---|
items | 当前页的结果数组 |
has_next_page | 如果还有更多结果,则为 true |
end_cursor | 将此作为 after 参数传入,以获取下一页。当 has_next_page 为 false 时为 null |
total | 匹配项的总数(出于性能原因,某些端点可能会省略该字段) |
示例:对会话进行分页
第一页
下一页
end_cursor 值:
汇总所有结果
从基于 offset 的分页方式迁移
offset/limit 替换为 after/first:
