Using this API you can automatically send files for transcription and subtitling.
All requests sent to gotranscript.com API must have token.
Example: https://gotranscript.com/api/v2/....?api_token=API_TOKEN
We will send POST request to your website url when transcription/subtitling will be finished.
Set your website url down below.
login to see formAll code examples will be in PHP. And for simplicity we will use curlGet() and curlPost() functions.
<?php function curlGet($url) { return curl($url); } function curlPost($url, array $data) { return curl($url, $data); } function curl($url, array $data = null) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); if ($data) { curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } $response = curl_exec($ch); curl_close($ch); return $response; }
Send your file url and parameters how file should be processed to gotranscript.com.
<?php $url = 'https://gotranscript.com/api/v2/audios/add?api_token=API_TOKEN'; $data = [ 'url' => 'http://your-url.com/audio.mp3', 'from' => 0, 'till' => 120, // file will we transcribed from 00:00:00 till 00:02:00 (2 minutes) 'language' => 'english', 'text_format' => 'clean_verbatim', 'timestamping' => 'not_required', 'turnaround_time' => '5_days', 'number_of_speakers' => '1_or_2', 'subtitles_and_cc' => 'not_required', 'comment' => 'Instructions for transcribers [optional]', ]; echo curlPost($url, $data);
Response will be in JSON format. You will get audio id and audio price.
{ "mode":"test", "status":"success", "data":{ "audio":{ "id":777, "price":77.77 } } }
If you forgot to change API_TOKEN or made other mistake, error will look like this:
{ "mode":"live", "status":"error", "errors":{"error":"Wrong api token"} }
Make payment from your wallet. Don't forget to change AUDIO_ID.
<?php $url = 'https://gotranscript.com/api/v2/audios/AUDIO_ID/pay?api_token=API_TOKEN'; echo curlGet($url);
Response:
{ "mode":"test", "status":"success", "data":null }
When our transcribers will finish file, POST request will be sent to your server. Code on our server looks like this:
// CODE ON gotranscript.com SERVER $url = 'http://your-server.com/file-finished'; $data = [ 'mode' => 'live', 'status' => 'success', 'audio_id' => 777, 'transcription_url' => 'https://gotranscript.com/api/v2/test/test-file/1?api_token=test', // API_TOKEN value will be set automatically 'subtitles_url' => 'https://gotranscript.com/api/v2/test/test-file/2?api_token=test', // present only when "srt" is chosen as "subtitles_and_cc" parameter ]; $response = curlPost($url, $data); if ($reponse == 'ok') { // your server received data } else { // retry request in 1 hour (up to 10 times) }
When your server receives data, it must output ok. If it will not output ok, we will send this request again every hour up to 10 times.
To test how your server responds to request from gotranscript.com, click on link below.
Test request to your server (without subtitles)When api is used in live mode (not in testing), you can go to login. There you will see your orders, and their status.
All orders made through API receive 20% discount.