Vai al contenuto principale
GET
/
v1
/
files
/
{file_id}
Dateimetadaten nach ID abrufen
curl --request GET \
  --url https://api.olostep.com/v1/files/{file_id} \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "object": "<string>",
  "created": 123,
  "filename": "<string>",
  "bytes": 123,
  "purpose": "<string>",
  "status": "<string>"
}

Descrizione

Questo endpoint consente di ottenere i metadati di un file specifico utilizzando il suo file_id. È utile per recuperare informazioni come il nome del file, la dimensione, il tipo e altre proprietà.

Richiesta

Metodo HTTP

GET

URL

/v1/files/{file_id}

Parametri del Percorso

  • file_id (stringa, obbligatorio): L’identificatore univoco del file di cui si vogliono ottenere i metadati.

Risposta

Corpo della Risposta

La risposta sarà un oggetto JSON contenente i seguenti campi:
  • id (stringa): L’ID del file.
  • name (stringa): Il nome del file.
  • size (intero): La dimensione del file in byte.
  • type (stringa): Il tipo MIME del file.
  • created_at (stringa): La data e l’ora di creazione del file nel formato ISO 8601.

Esempio di Risposta

{
  "id": "abc123",
  "name": "documento.pdf",
  "size": 102400,
  "type": "application/pdf",
  "created_at": "2023-01-01T12:00:00Z"
}

Codici di Stato

  • 200 OK: I metadati del file sono stati recuperati con successo.
  • 404 Not Found: Il file con l’ID specificato non esiste.
  • 401 Unauthorized: Autenticazione fallita o non fornita.
  • 500 Internal Server Error: Si è verificato un errore nel server.

Esempi

Richiesta Esempio

GET /v1/files/abc123 HTTP/1.1
Host: api.olostep.com
Authorization: Bearer {token}

Risposta Esempio

{
  "id": "abc123",
  "name": "documento.pdf",
  "size": 102400,
  "type": "application/pdf",
  "created_at": "2023-01-01T12:00:00Z"
}

Autorizzazioni

Authorization
string
header
obbligatorio

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Parametri del percorso

file_id
string
obbligatorio

Eindeutiger Bezeichner für die abzurufende Datei.

Risposta

Erfolgreiche Antwort mit Dateimetadaten.

id
string

Datei-ID

object
string

Die Art des Objekts. "file" für diesen Endpunkt.

created
integer

Erstellter Epoch-Zeitstempel

filename
string

Der Dateiname der hochgeladenen Datei

bytes
integer

Dateigröße in Bytes

purpose
string

Der Zweck der Datei

status
string

Dateistatus (z.B. 'pending', 'completed')