我正在尝试使用api更新页面的状态。我使用的是concept构建的JS-sdk。
要更新状态,必须更新属性对象。我不能使它按预期工作,它总是抛出一个错误。
我尝试使用属性的名称('Status'),并尝试使用属性的id,但出现相同的错误。
const response = await notion.pages.update({
page_id: 'abc123',
properties: {
[statusProp.id]: {
status: {
title: 'Done'
}
}
}
})
我收到的错误如下:
{
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`.rnbody.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`.'
}
他们的文档说:Not currently editable.
.
虽然我不确定他们是否只指状态属性的属性"颜色",或者他们是否指状态属性。
他们的文档图片。
试着把" title "改成" name "