V2
获取页面属性
按属性 ID 单独读取页面属性值,适合处理大字段或分页属性。
获取页面属性
适用场景
当某个页面属性很大、需要分页读取,或者你只想单独读取某一个属性值时,使用这个接口最合适。
接口信息
| 项目 | 内容 |
|---|---|
| 方法 | GET |
| 路径 | /v2/pages/:page_id/properties/:property_id |
| 请求体 | 无 |
| 返回 | property_item 或 list |
| Scope | pages.read |
权限要求
需要 pages.read。
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
page_id | string | 是 | 页面 ID。 |
property_id | string | 是 | 属性 ID,不是属性名。 |
start_cursor | string | 否 | 分页游标。 |
page_size | number | 否 | 默认 25。 |
响应结果
分页属性会返回 list:
{
"object": "list",
"type": "property_item",
"property_item": {
"object": "property_item",
"id": "title",
"type": "title"
},
"results": [
{
"type": "text",
"text": {
"content": "季度规划",
"link": null
},
"plain_text": "季度规划",
"href": null
}
],
"next_cursor": null,
"has_more": false
}
单值属性会直接返回 property_item:
{
"object": "property_item",
"id": "16161616-1616-4616-8616-161616161616",
"type": "select",
"select": {
"id": "18181818-1818-4818-8818-181818181818",
"name": "Doing",
"color": "yellow"
}
}
行为说明
property_id必须传属性 ID,不要传显示名。- 默认分页规则来自统一分页逻辑,但这个接口把默认值调整为
25。 title、rich_text、relation、people这类内容会以分页形式返回。- 其他单值属性通常直接返回
property_item。
错误提示
400 validation_error:参数不正确。401 unauthorized:token 无效或已过期。403 forbidden:缺少pages.read或无权访问页面。404 not_found:页面或属性不存在。
