Retrieving a Transcription Result
π Get Transcription Result API
Once you've uploaded your audio or video files, you'll need a convenient and reliable way to retrieve the transcriptions. That's where our Get Transcription Result API comes in.
If your file is longer than 3 hours, it will be divided into two orders and you should be able to see the new order ids in the content of this API call.
To get the results of your transcription orders, please use the following sample code:
import requests
import json
#order id to get content
given_order_id = 123456789
parameters = {
"orderid" : given_order_id
}
url = "https://api.transkriptor.com/3/Get-Content"
#if the order is still in processing phase, send the following request again.
response = requests.get(url, params = parameters)
content = json.loads(response.content)
if "content" in content:
print(content)
else:
print("Still processing the order. Send the last request later again.")
const axios = require('axios');
const givenOrderId = 123456789;
const parameters = {
orderid: givenOrderId
};
const url = 'https://api.transkriptor.com/3/Get-Content';
axios.get(url, { params: parameters })
.then(response => {
const content = response.data;
if ('content' in content) {
console.log(content);
} else {
console.log('Still processing the order. Send the last request later again.');
}
})
.catch(error => {
console.error(error);
});
import java.io.IOException;
import java.net.URL;
import java.util.Map;
import com.fasterxml.jackson.databind.ObjectMapper;
public class Main {
public static void main(String[] args) throws IOException {
int givenOrderId = 123456789;
String url = "https://api.transkriptor.com/3/Get-Content";
ObjectMapper mapper = new ObjectMapper();
URL requestUrl = new URL(url + "?orderid=" + givenOrderId);
Map<String, Object> content = mapper.readValue(requestUrl, Map.class);
if (content.containsKey("content")) {
System.out.println(content);
} else {
System.out.println("Still processing the order. Send the last request later again.");
}
}
}
using System;
using System.Net;
using System.IO;
using System.Text;
using Newtonsoft.Json;
class Program
{
static void Main()
{
int givenOrderId = 123456789;
string url = $"https://api.transkriptor.com/3/Get-Content?orderid={givenOrderId}";
using (WebClient client = new WebClient())
{
string response = client.DownloadString(url);
dynamic content = JsonConvert.DeserializeObject(response);
if (content["content"] != null)
{
Console.WriteLine(content);
}
else
{
Console.WriteLine("Still processing the order. Send the last request later again.");
}
}
}
}
package main
import (
"fmt"
"encoding/json"
"net/http"
"io/ioutil"
)
type Response struct {
Content map[string]interface{} `json:"content"`
}
func main() {
givenOrderId := 123456789
url := fmt.Sprintf("https://api.transkriptor.com/3/Get-Content?orderid=%d", givenOrderId)
resp, err := http.Get(url)
if err != nil {
fmt.Println(err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(err)
return
}
var data Response
err = json.Unmarshal(body, &data)
if err != nil {
fmt.Println(err)
return
}
if data.Content != nil {
fmt.Println(data)
} else {
fmt.Println("Still processing the order. Send the last request later again.")
}
}
require 'net/http'
require 'json'
given_order_id = 123456789
parameters = {
"orderid" => given_order_id
}
url = URI.parse("https://api.transkriptor.com/3/Get-Content")
url.query = URI.encode_www_form(parameters)
response = Net::HTTP.get(url)
content = JSON.parse(response)
if content.key?("content")
puts content
else
puts "Still processing the order. Send the last request later again."
end
<?php
$given_order_id = 123456789;
$parameters = array(
"orderid" => $given_order_id
);
$url = "https://api.transkriptor.com/3/Get-Content";
$response = file_get_contents($url . '?' . http_build_query($parameters));
$content = json_decode($response, true);
if (isset($content['content'])) {
print_r($content);
} else {
echo "Still processing the order. Send the last request later again.";
}
?>
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import com.google.gson.Gson
data class Response(val content: Map<String, Any>?)
fun main() {
val givenOrderId = 123456789
val url = "https://api.transkriptor.com/3/Get-Content?orderid=$givenOrderId"
val client = OkHttpClient()
val request = Request.Builder()
.url(url)
.build()
client.newCall(request).execute().use { response: Response ->
val responseBody = response.body?.string()
val gson = Gson()
val data = gson.fromJson(responseBody, Response::class.java)
if (data.content != null) {
println(data)
} else {
println("Still processing the order. Send the last request later again.")
}
}
}
import Foundation
let givenOrderId = 123456789
let url = URL(string: "https://api.transkriptor.com/3/Get-Content?orderid=\(givenOrderId)")!
let task = URLSession.shared.dataTask(with: url) { (data, response, error) in
guard let data = data else {
print("Error: \(error?.localizedDescription ?? "Unknown error")")
return
}
do {
let json = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any]
if let content = json?["content"] {
print(content)
} else {
print("Still processing the order. Send the last request later again.")
}
} catch {
print("Error: \(error.localizedDescription)")
}
}
task.resume()
import 'dart:convert';
import 'package:http/http.dart' as http;
void main() async {
final givenOrderId = 123456789;
final url = Uri.parse('https://api.transkriptor.com/3/Get-Content?orderid=$givenOrderId');
final response = await http.get(url);
if (response.statusCode == 200) {
final content = jsonDecode(response.body);
if (content.containsKey('content')) {
print(content);
} else {
print('Still processing the order. Send the last request later again.');
}
} else {
print('Error: ${response.statusCode}');
}
}
Change the File Name of Your Order
Using the following code you can change the file name of your transcription.
import requests
import json
# API endpoint
api_url = "https://um2vro8lrb.execute-api.eu-central-1.amazonaws.com/prod/filedirectory/renamefilebyorderid"
cid = 'your_user_id'
orderid = 'your_order_id'
new_name = "new_file_name"
# Parameters for the API call
params = {
'cid': cid,
'orderid': orderid,
'Tname': new_name
}
print(f"Making API call with parameters: {params}")
# Make the API call
response = requests.get(api_url, params=params)
# Check the status code
if response.status_code == 200:
print("API call successful.")
try:
data = response.json()
if data:
# Print the result
print(json.dumps(data, indent=4))
else:
print("No data found in the response.")
except json.JSONDecodeError:
print("Error decoding the JSON response.")
print("Response text:", response.text)
else:
print(f"API call failed with status code: {response.status_code}")
print("Response:", response.text)
const axios = require('axios');
const parameters = {
meetingUrl: 'MEETING URL HERE',
language: 'en-US',
apiKey: 'XXXXX'
};
axios.get('https://api.transkriptor.com/7/Add-Bot-to-Meeting', { params: parameters })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.log(error);
});
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
URL url = new URL("https://api.transkriptor.com/7/Add-Bot-to-Meeting?meetingUrl=MEETING URL HERE&language=en-US&apiKey=XXXXX");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;
StringBuffer content = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
content.append(inputLine);
}
in.close();
connection.disconnect();
System.out.println(content.toString());
using System;
using System.Net;
using Newtonsoft.Json;
var url = "https://api.transkriptor.com/7/Add-Bot-to-Meeting?meetingUrl=MEETING URL HERE&language=en-US&apiKey=XXXXX";
using (WebClient client = new WebClient())
{
string content = client.DownloadString(url);
var result = JsonConvert.DeserializeObject(content);
Console.WriteLine(result);
}
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
baseURL := "https://api.transkriptor.com/7/Add-Bot-to-Meeting"
params := url.Values{}
params.Add("meetingUrl", "MEETING URL HERE")
params.Add("language", "en-US")
params.Add("apiKey", "XXXXX")
response, err := http.Get(baseURL + "?" + params.Encode())
if err != nil {
panic(err)
}
defer response.Body.Close()
var content map[string]interface{}
json.NewDecoder(response.Body).Decode(&content)
fmt.Println(content)
}
require 'net/http'
require 'json'
uri = URI('https://api.transkriptor.com/7/Add-Bot-to-Meeting')
params = { :meetingUrl => 'MEETING URL HERE', :language => 'en-US', :apiKey => 'XXXXX' }
uri.query = URI.encode_www_form(params)
response = Net::HTTP.get_response(uri)
content = JSON.parse(response.body)
puts content
<?php
$url = "https://api.transkriptor.com/7/Add-Bot-to-Meeting";
$parameters = array(
"meetingUrl" => "MEETING URL HERE",
"language" => "en-US",
"apiKey" => "XXXXX"
);
$response = file_get_contents($url . '?' . http_build_query($parameters));
$content = json_decode($response, true);
print_r($content);
?>
import java.net.URL
fun main() {
val url = URL("https://api.transkriptor.com/7/Add-Bot-to-Meeting?meetingUrl=MEETING URL HERE&language=en-US&apiKey=XXXXX")
val content = url.readText()
println(content)
}
import Foundation
if let url = URL(string: "https://api.transkriptor.com/7/Add-Bot-to-Meeting?meetingUrl=MEETING URL HERE&language=en-US&apiKey=XXXXX") {
URLSession.shared.dataTask(with: url) { data, response, error in
if let data = data {
let content = try? JSONSerialization.jsonObject(with: data, options: [])
print(content)
}
}.resume()
}
import 'dart:convert';
import 'package:http/http.dart' as http;
void main() async {
final url = 'https://api.transkriptor.com/7/Add-Bot-to-Meeting?meetingUrl=MEETING URL HERE&language=en-US&apiKey=XXXXX';
final response = await http.get(Uri.parse(url));
if (response.statusCode == 200) {
var content = jsonDecode(response.body);
print(content);
}
}
Response
200 OK - Completed Transcription
{
"sound": "https://mp3buckets.s3.eu-central-1.amazonaws.com/2d6f0ac2e0527bcde9735f337e8c2027.mp3",
"content": [{"text": "Sentence 1 example.", "StartTime": 320, "EndTime": 1754, "VoiceStart": 320, "VoiceEnd": 1754, "Speaker": "SPK_1"}],
"service": "Standard",
"status": "Completed",
"language": "en-US"
}
200 OK - Transcription In Progress
{
"service": "Standard",
"status": "Processing",
"language": "en-US"
}
{
"service": "Standard",
"status": "Progressing",
"language": "en-US"
}
200 OK - Failed Transcription
{
"service": "Standard",
"status": "Failed",
"language": "en-US",
"failCode": "ISB"
}
{
"service": "Standard",
"status": "Failed",
"language": "en-US",
"failCode": "UF"
}
{
"service": "Standard",
"status": "Failed",
"language": "en-US",
"failCode": "IFT"
}
{
"service": "Standard",
"status": "Failed",
"language": "en-US",
"failCode": "LT3",
"newOrder1": "100002",
"newOrder2": "100003"
}
404 Not Found - Order Not Found
{
"message": "Order not found"
}
Updated 5 months ago