Postman 将页面添加到多列概念数据库有时工作正常,有时对相同的输入产生验证错误

Postman 将页面添加到多列概念数据库有时工作正常,有时对相同的输入产生验证错误,postman,notion-api,Postman,Notion Api,基本上,我使用邮递员将POST请求发送到 它在70%的时间内有效,其余时间有时会出现以下错误。也就是说,对于相同的输入 { "object": "error", "status": 400, "code": "validation_error", "message": "body failed validation. Fix one:

基本上,我使用邮递员将POST请求发送到

它在70%的时间内有效,其余时间有时会出现以下错误。也就是说,对于相同的输入

{
    "object": "error",
    "status": 400,
    "code": "validation_error",
    "message": "body failed validation. Fix one: body.parent.type should be not present, instead was `\"database_id\"`. body.parent.page_id should be defined, instead was `undefined`."
}
我的身体是这样开始的

{
    "parent": {
        "type": "database_id",
        "database_id": "a94c42320ef04b6a9c1a7e5e73455557"
    },
    "properties": {
        "Title": {
..................
我不是发布整个身体,因为它有时工作完美无瑕


请帮帮我。有什么方法可以检查到我页面的请求日志吗?

首先,我发现类型:database\u id在parent中不是必需的

我还发现负载中的语法错误返回400错误:

body failed validation. Fix one: body.parent.type should be not present, instead was `\"database_id\"`. body.parent.page_id should be defined, instead was `undefined`.
在我的例子中,我错误地添加了与父属性处于同一级别的值。像这样:

{
    "parent": {
        "database_id": "<database_id>"
    },
    "properties": {
        ...
    },
    "wrong_value": {}
}
{
“家长”:{
“数据库\u id”:”
},
“财产”:{
...
},
“错误的_值”:{}
}
由于错误没有那么具体,请检查您是否像我一样犯了同样的错误,同时请再次检查您试图发布到的父级是否是数据库,而不是页面。

问题在于请求数据中的“父级”中有“type:database\u id”

{
    "parent": {
        "type": "database_id",(REMOVE THIS LINE)
        "database_id": "a94c42320ef04b6a9c1a7e5e73455557"
    },
    "properties": {
        "Title": {
..................

删除“类型”后,它工作正常。Concept需要更新他们的文档。

找到了一个临时解决方案:只需添加一个while循环来发送POST请求,直到响应代码为200。工作完美。我没有那样做。我猜问题是添加了“type”:“database_id”。移除后,一切正常。是的,在看到我的答案后,您立即回答了自己的问题?