概念API:如何获取上传文件的URL

Notion API: how to get the URL of uploaded files

我正在使用 Notion API Beta,从 table 中读取我感兴趣的“文件和媒体”属性 的页面。API 响应只是给我上传到那里的文件的名称,但我没有 URL 来实际访问它们。我错过了什么?谢谢

{
  "Photo": {
    "id": "xxxx",
    "type": "files",
    "files": [
      {
        "name": "000150748673-ofnuhb-t500x500.jpg"
      }
    ]
  }
}

更新: 参见


The Notion API 目前不支持文件上传或下载(Notion-版本:2021-05-13)。它不会 return 一个 URL 到存储的文件。

已更新 API 和 it now provides a temporary authenticated URL to files uploaded in Notion。例如:

{
  "Photo": {
    "id": "xxxx",
    "type": "files",
    "files": [
      {
        "name": "000150748673-ofnuhb-t500x500.jpg",
        "type": "file",
        "file": {
          "url": "https://s3.us-west-2.amazonaws.com/...",
          "expiry_time": "2021-09-22T09:00:56.029Z"
        }
      }
    ]
  }
}