跳至主要內容
API 參考
API 參考

擷取檔案內容

串流傳輸已儲存檔案的確切位元組。

串流傳輸已儲存檔案的確切位元組。

端點

GET /v1/files/:file_id/content
基礎 URL
https://runapi.ai
API 版本
v1
身份驗證
Authorization: Bearer YOUR_API_KEY
02

請求

JSON 內容

僅在列出的請求位置傳送值。

路徑參數1 個欄位
file_idstring
必填

RunAPI 檔案 ID。

03

成功回應

HTTP 200

GET /v1/files/:file_id/content

JSON
"binary File content"
04

錯誤回應(401)

HTTP 401
回應結構
JSON
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}

回應範例

JSON
{
  "error": {
    "code": "authentication_error",
    "message": "Missing API key",
    "param": null,
    "type": "authentication_error"
  }
}
05

錯誤回應(404)

HTTP 404
回應結構
JSON
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}

回應範例

JSON
{
  "error": {
    "code": "not_found",
    "message": "File not found",
    "param": null,
    "type": "invalid_request_error"
  }
}
06

錯誤回應(502)

HTTP 502
回應結構
JSON
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}

回應範例

JSON
{
  "error": {
    "code": "storage_write_failed",
    "message": "File storage failed",
    "param": null,
    "type": "server_error"
  }
}
07

cURL 範例

CURL
curl -X GET https://runapi.ai/v1/files/file_abc123/content \
  -H 'Authorization: Bearer YOUR_API_KEY'