小编vik*_*orf的帖子

无法使用 notion api 更新页面属性的状态

我正在尝试使用 api 更新页面的状态。我使用的是notion构建的JS-sdk。

要更新状态,您必须更新属性对象。我无法让它按预期工作,它总是抛出错误。

我尝试使用属性的名称(“状态”),并且尝试使用属性的 id,但出现了相同的错误。

const response = await notion.pages.update({
    page_id: 'abc123',
    properties: {
        [statusProp.id]: {
            status: {
                title: 'Done'
            }
        }
    }
})
Run Code Online (Sandbox Code Playgroud)

我收到的错误如下:

{
object: 'error',
status: 400,
code: 'validation_error',
message:
    'body failed validation. Fix one:\nbody.properties.bSYl.title should be defined, instead was `undefined`.\nbody.properties.bSYl.rich_text should be defined, instead was `undefined`.\r\nbody.properties.bSYl.number should be defined, instead was `undefined`.\nbody.properties.bSYl.url should be defined, instead was `undefined`.\nbody.properties.bSYl.select should be defined, instead was `undefined`.\nbody.properties.bSYl.multi_select should be defined, instead was `undefined`.\nbody.properties.bSYl.people should be defined, instead was …
Run Code Online (Sandbox Code Playgroud)

javascript node.js notion-api

5
推荐指数
1
解决办法
1674
查看次数

标签 统计

javascript ×1

node.js ×1

notion-api ×1