开发者

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

开发者 https://www.devze.com 2022-12-07 20:50 出处:网络
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:

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

精彩评论

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

关注公众号