Get File Detail
π Get File Details by Order ID
Use this endpoint to obtain file details for a specific file by providing an order_id
.
π Request Parameters
- order_id (string): The unique identifier for the file order whose details you wish to retrieve.
π Response
The response will contain the details associated with the specified order_id
.
β οΈ Make sure the order_id
is valid.
import requests
order_id = "example_order_id" # Replace with your order id
api_key = 'your_api_key_here' # Replace with your actual API key
# Set up the headers, including the API key
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {api_key}',
'Accept': 'application/json'
}
url = f"https://api.tor.app/developer/files/{order_id}"
response = requests.get(url, headers=headers)
response_json = response.json()
print(response_json)
const axios = require('axios');
const orderId = "example_order_id"; // Replace with your order id
const apiKey = 'your_api_key_here'; // Replace with your actual API key
// Set up the headers, including the API key
const headers = {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`,
'Accept': 'application/json'
};
const url = `https://api.tor.app/developer/files/${orderId}`;
axios.get(url, { headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error.response ? error.response.data : error.message);
});
import okhttp3.*;
import org.json.JSONObject;
public class GetFileInfo {
private static final String API_KEY = "your_api_key_here"; // Replace with your actual API key
private static final String ORDER_ID = "example_order_id"; // Replace with your order id
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
String url = "https://api.tor.app/developer/files/" + ORDER_ID;
Request request = new Request.Builder()
.url(url)
.addHeader("Authorization", "Bearer " + API_KEY)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
try (Response response = client.newCall(request).execute()) {
if (response.isSuccessful()) {
String responseData = response.body().string();
JSONObject json = new JSONObject(responseData);
System.out.println(json.toString(2));
} else {
System.out.println("Request failed: " + response.code());
}
}
}
}
using System;
using System.Net.Http;
using System.Text.Json;
using System.Threading.Tasks;
public class Program
{
private static readonly string apiKey = "your_api_key_here"; // Replace with your actual API key
private static readonly string orderId = "example_order_id"; // Replace with your order id
public static async Task Main()
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {apiKey}");
var url = $"https://api.tor.app/developer/files/{orderId}";
var response = await client.GetAsync(url);
if (response.IsSuccessStatusCode)
{
var responseJson = await response.Content.ReadAsStringAsync();
var data = JsonSerializer.Deserialize<JsonDocument>(responseJson);
Console.WriteLine(data.RootElement.ToString());
}
else
{
Console.WriteLine($"Request failed with status: {response.StatusCode}");
}
}
}
package main
import (
"encoding/json"
"fmt"
"net/http"
)
const (
apiKey = "your_api_key_here" // Replace with your actual API key
orderId = "example_order_id" // Replace with your order id
)
func main() {
url := fmt.Sprintf("https://api.tor.app/developer/files/%s", orderId)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer "+apiKey)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Request failed:", err)
return
}
defer resp.Body.Close()
if resp.StatusCode == http.StatusOK {
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
} else {
fmt.Printf("Request failed with status: %d\n", resp.StatusCode)
}
}
require 'net/http'
require 'json'
require 'uri'
order_id = "example_order_id" # Replace with your order id
api_key = "your_api_key_here" # Replace with your actual API key
url = URI("https://api.tor.app/developer/files/#{order_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer #{api_key}"
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
response = http.request(request)
if response.code.to_i == 200
response_json = JSON.parse(response.body)
puts response_json
else
puts "Request failed with status: #{response.code}"
end
<?php
$orderId = "example_order_id"; // Replace with your order id
$apiKey = "your_api_key_here"; // Replace with your actual API key
$url = "https://api.tor.app/developer/files/$orderId";
$headers = [
"Authorization: Bearer $apiKey",
"Content-Type: application/json",
"Accept: application/json"
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode == 200) {
$responseJson = json_decode($response, true);
print_r($responseJson);
} else {
echo "Request failed with status: $httpCode\n";
}
?>
import okhttp3.OkHttpClient
import okhttp3.Request
fun main() {
val apiKey = "your_api_key_here" // Replace with your actual API key
val orderId = "example_order_id" // Replace with your order id
val client = OkHttpClient()
val url = "https://api.tor.app/developer/files/$orderId"
val request = Request.Builder()
.url(url)
.addHeader("Authorization", "Bearer $apiKey")
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build()
client.newCall(request).execute().use { response ->
if (response.isSuccessful) {
println(response.body()?.string())
} else {
println("Request failed with status: ${response.code()}")
}
}
}
import Foundation
let orderId = "example_order_id" // Replace with your order id
let apiKey = "your_api_key_here" // Replace with your actual API key
let url = URL(string: "https://api.tor.app/developer/files/\(orderId)")!
var request = URLRequest(url: url)
request.addValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("application/json", forHTTPHeaderField: "Accept")
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data, error == nil else {
print("Request failed:", error ?? "Unknown error")
return
}
if let httpResponse = response as? HTTPURLResponse, httpResponse.statusCode == 200 {
let responseJson = try? JSONSerialization.jsonObject(with: data, options: [])
print(responseJson ?? "Failed to parse response")
} else {
print("Request failed with status:", (response as? HTTPURLResponse)?.statusCode ?? 0)
}
}
task.resume()
import 'dart:convert';
import 'dart:io';
void main() async {
const orderId = "example_order_id"; // Replace with your order id
const apiKey = "your_api_key_here"; // Replace with your actual API key
final url = Uri.parse("https://api.tor.app/developer/files/$orderId");
final request = await HttpClient().getUrl(url)
..headers.set("Authorization", "Bearer $apiKey")
..headers.set("Content-Type", "application/json")
..headers.set("Accept", "application/json");
final response = await request.close();
if (response.statusCode == 200) {
final responseBody = await response.transform(utf8.decoder).join();
final responseJson = jsonDecode(responseBody);
print(responseJson);
} else {
print("Request failed with status: ${response.statusCode}");
}
}
200 OK
{
"statusCode": 200,
"body": {
"file_id": "#Transkription#01JC5GSM62C7NCJHXG7ZWHRWW7",
"file_name": "danzio123",
"parent_folder_id": "User#a9457250cfcd7b419690b2266ecf291e7ca27b84e297e58a532d3accf81e0596b14471571f74c4c18704af2afe746f7c0ec518bbcbe2312b238a06b02f1b35ef",
"order_id": "1731057205440528558",
"created_at": "1731057211504",
"status": "Completed"
}
}
400 Missing Parameters
{
"statusCode": 400,
"body": {
'message': "Missing parameters: "
}
}
404 Not Found
{
"statusCode": 404,
"body": {
'message': "File not found. "
}
}
500 Internal Server Error
{
"statusCode": 500,
"body": "Internal server error"
}
Updated about 1 month ago