Get File
GET
/
v1
/
files
/
:file_id
Get File
curl --request GET \
--url https://api.neosantara.xyz/v1/files/:file_id \
--header 'x-api-key: <api-key>'import requests
url = "https://api.neosantara.xyz/v1/files/:file_id"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.neosantara.xyz/v1/files/:file_id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.neosantara.xyz/v1/files/:file_id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.neosantara.xyz/v1/files/:file_id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.neosantara.xyz/v1/files/:file_id")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.neosantara.xyz/v1/files/:file_id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"bytes": 123,
"created_at": 123,
"filename": "<string>",
"purpose": "<string>",
"status": "<string>",
"status_details": {}
}Retrieve metadata information about a specific uploaded file.
string
required
The ID of the file to retrieve (e.g.,
file-abc123).Returns
string
The unique identifier of the file.
string
The object type, which is always
file.integer
The size of the file in bytes.
integer
The Unix timestamp (in seconds) of when the file was created.
string
The name of the file.
string
The purpose of the file.
string
The current status of the file.
string or null
Additional details about the file status.
Return Examples
Response 200
{
"id": "file-abc123",
"object": "file",
"bytes": 120000,
"created_at": 1699564800,
"filename": "batch_requests.jsonl",
"purpose": "batch",
"status": "uploaded",
"status_details": null
}
Error 404 - File Not Found
{
"error": {
"message": "File not found or access denied",
"type": "invalid_request_error",
"code": "file_not_found"
}
}
Error 410 - File Expired
{
"error": {
"message": "File has expired",
"type": "invalid_request_error",
"code": "file_expired"
}
}
⌘I
Get File
curl --request GET \
--url https://api.neosantara.xyz/v1/files/:file_id \
--header 'x-api-key: <api-key>'import requests
url = "https://api.neosantara.xyz/v1/files/:file_id"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.neosantara.xyz/v1/files/:file_id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.neosantara.xyz/v1/files/:file_id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.neosantara.xyz/v1/files/:file_id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.neosantara.xyz/v1/files/:file_id")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.neosantara.xyz/v1/files/:file_id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"bytes": 123,
"created_at": 123,
"filename": "<string>",
"purpose": "<string>",
"status": "<string>",
"status_details": {}
}