开发者

Possible Notion API bug - Can't create Database Page with URL data

I have a Notion database that I'm trying to write to via the API.

I can write to text fields, but when I try to write to a URL field, I receive the following error:

{
    "object": "error",
    "status": 400,
    "code": "validation_error",
    "message": "body failed validation. Fix one:\nbody.properties.O?HT.id should be defined, instead was `undefined`.\nbody.properties.O?HT.name should be defined, instead was `undefined`.\nbody.properties.O?HT.start should be defined, instead was `undefined`."
}

This is the API description of that field:

"LinkedIn": {
    "id": "O%3FHT",
    "name": "LinkedIn",
    "type": "url",
    "url": {}
},

This is the body of the API POST request that's failing:

{
    "parent": {
        "database_id": "f016c02beeff4a34bf298ceb8a8a079f"
    },
    "properties": {
        "title": [
            {
                "text": {
                    "content": "Mark Zuckerberg"
                }
            }
        ],
        "%3DCzE": [
            {
                "text": {
                    "content": "CEO"
                }
            }
        ],
        "HihI": [
            {
                "text": {
                    "content": "Facebook"
                }
            }
        ],
        "JC%3BS": [
            {
                "text": {
                    &quo开发者_开发知识库t;content": "Menlo Park, CA"
                }
            }
        ],
        "O%3FHT": {
                "url": "https://www.linkedin.com/in/mark-zuckerberg/"
        },
        "wS%7BN": {
                "url": "https://www.linkedin.com/company/facebook/mycompany/verification/"
        }
    }
}

I'm basing the body contents on the Postman docs provided by Notion: https://www.postman.com/notionhq/workspace/notion-s-api-workspace/documentation/15568543-d990f9b7-98d3-47d3-9131-4866ab9c6df2

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜