我正在尝试使用 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)