vik*_*orf 5 javascript node.js 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 `undefined`.\nbody.properties.bSYl.email should be defined, instead was `undefined`.\nbody.properties.bSYl.phone_number should be defined, instead was `undefined`.\nbody.properties.bSYl.date should be defined, instead was `undefined`.\nbody.properties.bSYl.checkbox should be defined, instead was `undefined`.\nbody.properties.bSYl.relation should be defined, instead was `undefined`.\nbody.properties.bSYl.files should be defined, instead was `undefined`.\nbody.properties.bSYl.id should be defined, instead was `undefined`.\nbody.properties.bSYl.name should be defined, instead was `undefined`.\nbody.properties.bSYl.start should be defined, instead was `undefined`.'
Run Code Online (Sandbox Code Playgroud)
}
他们的文档说:Not currently editable..
虽然我不确定它们是否仅意味着状态属性的属性“颜色”,或者是否意味着状态属性。
他们的医生的图片。
| 归档时间: |
|
| 查看次数: |
1674 次 |
| 最近记录: |