Przejdź do treści
Dokumentacja API
Dokumentacja API

Pobierz zawartość pliku

Prześlij strumieniowo dokładne bajty przechowywanego pliku.

Prześlij strumieniowo dokładne bajty przechowywanego pliku.

Punkt końcowy

GET /v1/files/:file_id/content
Bazowy URL
https://runapi.ai
Wersja API
v1
Uwierzytelnianie
Authorization: Bearer YOUR_API_KEY
02

Żądanie

Treść JSON

Wysyłaj wartości wyłącznie w podanej lokalizacji żądania.

Parametry ścieżki1 pole
file_idstring
Wymagane

Identyfikator pliku RunAPI.

03

Odpowiedź sukcesu

HTTP 200

GET /v1/files/:file_id/content

JSON
"binary File content"
04

Odpowiedź błędu (401)

HTTP 401
Schemat odpowiedzi
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"
}

Przykład odpowiedzi

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

Odpowiedź błędu (404)

HTTP 404
Schemat odpowiedzi
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"
}

Przykład odpowiedzi

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

Odpowiedź błędu (502)

HTTP 502
Schemat odpowiedzi
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"
}

Przykład odpowiedzi

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

Przykład cURL

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