【问题标题】:Python, Notion.Get relational tables dataPython, Notion.获取关系表数据
【发布时间】:2021-09-22 11:27:52
【问题描述】:

我尝试获取概念表数据,但关系表只返回页面的 ID,没有实际数据。如何使用关系 ID 获取数据?

databaseId ='my_database_id'
headers = {
    "Authorization": "Bearer " + token,
    "Content-Type": "application/json",
    "Notion-Version": "2021-05-13"
}
def readDatabase(databaseId, headers):
    readUrl = f"https://api.notion.com/v1/databases/{databaseId}/query"
    res = requests.request("POST", readUrl, headers=headers)
    data = res.json()
    print(res.text)

【问题讨论】:

    标签: python notion-api


    【解决方案1】:

    关系 ID 是页面 ID。您可以使用GET /pages endpoint[GET /blocks endpoint][1]查询信息

    【讨论】:

      猜你喜欢
      • 2021-09-06
      • 1970-01-01
      • 2021-08-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多