Get Summary

📖 Get Summary

Retrieve the AI-generated summary for a specific transcription. Returns a presigned URL to download the summary as a JSON file.


💡 Note: You need the order_id from your transcription to retrieve its summary. Not all transcriptions have summaries - the transcription must have been processed with summary generation enabled.

import requests

url = "https://api.tor.app/developer/transcription/summary"
api_key = "your_api_key"  # Replace with your actual API key

params = {
    "order_id": "your-transcription-order-id"  # Your transcription order ID
}

headers = {
    "Authorization": f"Bearer {api_key}"
}

response = requests.get(url, params=params, headers=headers)

if response.status_code == 200:
    data = response.json()
    print("Success:", data["success"])
    print("Order ID:", data["order_id"])
    print("Summary URL:", data["summary_url"])
    
    # Download the summary JSON file
    summary_response = requests.get(data["summary_url"])
    if summary_response.status_code == 200:
        summary = summary_response.json()
        print("Summary:", summary)
else:
    print("Failed:", response.status_code, response.text)
const axios = require('axios');

const apiKey = 'your_api_key'; // Replace with your actual API key
const url = 'https://api.tor.app/developer/transcription/summary';

const params = {
    order_id: 'your-transcription-order-id' // Your transcription order ID
};

const headers = {
    'Authorization': `Bearer ${apiKey}`
};

axios.get(url, { params, headers })
    .then(async response => {
        console.log('Success:', response.data.success);
        console.log('Order ID:', response.data.order_id);
        console.log('Summary URL:', response.data.summary_url);
        
        // Download the summary JSON file
        const summaryResponse = await axios.get(response.data.summary_url);
        console.log('Summary:', summaryResponse.data);
    })
    .catch(error => {
        console.error('Failed:', error.response ? error.response.data : error.message);
    });
import okhttp3.*;
import org.json.JSONObject;

public class GetSummary {
    private static final String API_KEY = "your_api_key";

    public static void main(String[] args) throws Exception {
        OkHttpClient client = new OkHttpClient();
        String url = "https://api.tor.app/developer/transcription/summary?order_id=your-transcription-order-id";

        Request request = new Request.Builder()
            .url(url)
            .get()
            .addHeader("Authorization", "Bearer " + API_KEY)
            .build();

        try (Response response = client.newCall(request).execute()) {
            if (response.isSuccessful()) {
                JSONObject data = new JSONObject(response.body().string());
                System.out.println("Success: " + data.getBoolean("success"));
                System.out.println("Order ID: " + data.getString("order_id"));
                System.out.println("Summary URL: " + data.getString("summary_url"));
                
                // Download the summary JSON file
                Request summaryRequest = new Request.Builder()
                    .url(data.getString("summary_url"))
                    .build();
                    
                try (Response summaryResponse = client.newCall(summaryRequest).execute()) {
                    System.out.println("Summary: " + summaryResponse.body().string());
                }
            } else {
                System.out.println("Failed: " + response.body().string());
            }
        }
    }
}
using System;
using System.Net.Http;
using System.Text.Json;
using System.Threading.Tasks;

public class GetSummary
{
    private static readonly string apiKey = "your_api_key";

    public static async Task Main()
    {
        var client = new HttpClient();
        var url = "https://api.tor.app/developer/transcription/summary?order_id=your-transcription-order-id";

        client.DefaultRequestHeaders.Add("Authorization", $"Bearer {apiKey}");

        var response = await client.GetAsync(url);
        var responseContent = await response.Content.ReadAsStringAsync();

        if (response.IsSuccessStatusCode)
        {
            var data = JsonDocument.Parse(responseContent).RootElement;
            Console.WriteLine("Success: " + data.GetProperty("success").GetBoolean());
            Console.WriteLine("Order ID: " + data.GetProperty("order_id").GetString());
            Console.WriteLine("Summary URL: " + data.GetProperty("summary_url").GetString());
            
            // Download the summary JSON file
            var summaryUrl = data.GetProperty("summary_url").GetString();
            var summaryResponse = await client.GetAsync(summaryUrl);
            var summary = await summaryResponse.Content.ReadAsStringAsync();
            Console.WriteLine("Summary: " + summary);
        }
        else
        {
            Console.WriteLine("Failed: " + responseContent);
        }
    }
}
package main

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
)

const apiKey = "your_api_key"

func main() {
	url := "https://api.tor.app/developer/transcription/summary?order_id=your-transcription-order-id"

	req, _ := http.NewRequest("GET", url, nil)
	req.Header.Set("Authorization", "Bearer "+apiKey)

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	defer resp.Body.Close()

	body, _ := ioutil.ReadAll(resp.Body)

	if resp.StatusCode == 200 {
		var data map[string]interface{}
		json.Unmarshal(body, &data)
		fmt.Println("Success:", data["success"])
		fmt.Println("Order ID:", data["order_id"])
		fmt.Println("Summary URL:", data["summary_url"])
		
		// Download the summary JSON file
		summaryResp, _ := http.Get(data["summary_url"].(string))
		defer summaryResp.Body.Close()
		summaryBody, _ := ioutil.ReadAll(summaryResp.Body)
		fmt.Println("Summary:", string(summaryBody))
	} else {
		fmt.Println("Failed:", string(body))
	}
}
<?php
$apiKey = "your_api_key";
$url = "https://api.tor.app/developer/transcription/summary?order_id=your-transcription-order-id";

$headers = [
    "Authorization: Bearer $apiKey"
];

$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) {
    $data = json_decode($response, true);
    echo "Success: " . ($data["success"] ? "true" : "false") . "\n";
    echo "Order ID: " . $data["order_id"] . "\n";
    echo "Summary URL: " . $data["summary_url"] . "\n";
    
    // Download the summary JSON file
    $summary = file_get_contents($data["summary_url"]);
    echo "Summary: " . $summary . "\n";
} else {
    echo "Failed: " . $response . "\n";
}
?>
require 'net/http'
require 'json'
require 'uri'

api_key = "your_api_key"
url = URI("https://api.tor.app/developer/transcription/summary?order_id=your-transcription-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}"

response = http.request(request)

if response.code.to_i == 200
  data = JSON.parse(response.body)
  puts "Success: #{data['success']}"
  puts "Order ID: #{data['order_id']}"
  puts "Summary URL: #{data['summary_url']}"
  
  # Download the summary JSON file
  summary_uri = URI(data['summary_url'])
  summary_response = Net::HTTP.get(summary_uri)
  puts "Summary: #{summary_response}"
else
  puts "Failed: #{response.body}"
end
import okhttp3.*
import org.json.JSONObject

fun main() {
    val apiKey = "your_api_key"
    val url = "https://api.tor.app/developer/transcription/summary?order_id=your-transcription-order-id"

    val client = OkHttpClient()

    val request = Request.Builder()
        .url(url)
        .get()
        .addHeader("Authorization", "Bearer $apiKey")
        .build()

    client.newCall(request).execute().use { response ->
        if (response.isSuccessful) {
            val data = JSONObject(response.body()?.string())
            println("Success: ${data.getBoolean("success")}")
            println("Order ID: ${data.getString("order_id")}")
            println("Summary URL: ${data.getString("summary_url")}")
            
            // Download the summary JSON file
            val summaryRequest = Request.Builder()
                .url(data.getString("summary_url"))
                .build()
                
            client.newCall(summaryRequest).execute().use { summaryResponse ->
                println("Summary: ${summaryResponse.body()?.string()}")
            }
        } else {
            println("Failed: ${response.body()?.string()}")
        }
    }
}
import Foundation

let apiKey = "your_api_key"
let url = URL(string: "https://api.tor.app/developer/transcription/summary?order_id=your-transcription-order-id")!

var request = URLRequest(url: url)
request.httpMethod = "GET"
request.addValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let httpResponse = response as? HTTPURLResponse {
        if let data = data {
            if httpResponse.statusCode == 200 {
                if let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any] {
                    print("Success: \(json["success"] ?? false)")
                    print("Order ID: \(json["order_id"] ?? "")")
                    print("Summary URL: \(json["summary_url"] ?? "")")
                    
                    // Download the summary JSON file
                    if let summaryUrlString = json["summary_url"] as? String,
                       let summaryUrl = URL(string: summaryUrlString) {
                        let summaryTask = URLSession.shared.dataTask(with: summaryUrl) { summaryData, _, _ in
                            if let summaryData = summaryData,
                               let summary = String(data: summaryData, encoding: .utf8) {
                                print("Summary: \(summary)")
                            }
                        }
                        summaryTask.resume()
                    }
                }
            } else {
                print("Failed: \(String(data: data, encoding: .utf8) ?? "")")
            }
        }
    }
}
task.resume()

RunLoop.main.run()
import 'dart:convert';
import 'package:http/http.dart' as http;

void main() async {
  const apiKey = 'your_api_key';
  final url = Uri.parse('https://api.tor.app/developer/transcription/summary?order_id=your-transcription-order-id');

  final response = await http.get(
    url,
    headers: {
      'Authorization': 'Bearer $apiKey'
    },
  );

  if (response.statusCode == 200) {
    final data = jsonDecode(response.body);
    print('Success: ${data["success"]}');
    print('Order ID: ${data["order_id"]}');
    print('Summary URL: ${data["summary_url"]}');
    
    // Download the summary JSON file
    final summaryResponse = await http.get(Uri.parse(data["summary_url"]));
    print('Summary: ${summaryResponse.body}');
  } else {
    print('Failed: ${response.body}');
  }
}

Query Parameters


ParameterTypeRequiredDescription
order_idstringYesThe transcription order ID

Response


200 OK - Summary Retrieved Successfully
{
    "success": true,
    "order_id": "your-transcription-order-id",
    "summary_url": "presigned-url"
}

Use the summary_url to download the summary JSON file. The URL is a presigned S3 URL that expires after a limited time.

404 Not Found - Summary Not Found
{
    "success": false,
    "order_id": "your-transcription-order-id",
    "message": "No summary found for this order. The transcription may not have a summary yet."
}

401 Unauthorized - Missing or Invalid API Key
{
    "success": false,
    "message": "Missing or invalid Authorization header. Expected: Bearer {api_key}"
}

500 Internal Server Error
{
    "success": false,
    "message": "Error retrieving summary"
}


Downloading the Summary


After receiving a successful response, use the summary_url to download the summary JSON file:

curl -o summary.json "presigned-url"