1、准备工作:
1)添加Integration:https://www.notion.so/my-integrations
2)copy secret:secret_xxxxxxxxxxxxxxxxxxxxx
3)在数据库所在页面右上角share integration
4)找到database ID (点击数据库标题,copy link)
例如:30ee492b0e6d4ccvfveeverrw69146ebc7fd79
2、ios创建Shortut(快捷指令)
URL:https://api.notion.com/v1/pages
1) POST request
2) Headers:
Content-Type: application/json
Notion-Version:2022-02-22
Authorization: Bearer secret_xxxxxxxxxxxxxxxxxxx
3) JSON TEXT
复制后确认与以下格式一致。
{ "parent": { "database_id": "0b6ee2bd143c4cc3b0f52fec2ce292ce" }, "properties": { "任务名称": { "title": [ { "text": { "content": "todo1" } } ] }, "类型": { "select": { "name": "学习" } } } }
如果想添加其他格式的properties应该在JSON body里如何体现?
- 不同property object格式:https://developers.notion.com/reference/property-value-object
- create page API reference:https://developers.notion.com/reference/post-page