Post Request Job
Welcome to the Post Request Job API – the ultimate tool to convert audio into precise text! This endpoint empowers your app to process audio files and return accurate transcriptions, streamlining workflows and enhancing accessibility.
Whether you’re building transcription tools, customer service analytics, or voice-driven applications – this API has you covered. Let's get started!
Endpoint
To kick off the transcription process, make a POST request to the following endpoint:
https://api.betatel.com/api/v1/stt/job
Headers
Don't forget your headers – they're your golden ticket to a successful request.
Param | Value | Description |
---|---|---|
Content-type | multipart/form-data | |
x-api-key | {{x-api-key}} | Your unique API key for secure access. |
x-user-id | {{x-user-id}} | Your user identifier for added security and tracking. |
Request Body
Your request needs to contain two essential pieces:
Param | Value | Type | Required | Description |
---|---|---|---|---|
file | conversation1.mp3 | Yes | ||
language | nl | Yes |
Let’s Get Coding!
Time to roll up those sleeves. Choose your favorite language and get started with the examples below.
- cUrl
- Python
- Node.js
- PHP
- Java
- C#
curl --location 'https://dev.api.betatel.com/api/v1/stt/job' \
--header 'x-user-id: 6757f3ffb5e62f0ce0e513a2' \
--header 'x-api-key: ••••••' \
--form 'file=@"/C:/Users/User/Desktop/conversation1.mp3"' \
--form 'language="nl"'
import http.client
import mimetypes
from codecs import encode
conn = http.client.HTTPSConnection("dev.api.betatel.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=file; filename={0}'.format('/C:/Users/User/Desktop/conversation1.mp3')))
fileType = mimetypes.guess_type('/C:/Users/User/Desktop/conversation1.mp3')[0] or 'application/octet-stream'
dataList.append(encode('Content-Type: {}'.format(fileType)))
dataList.append(encode(''))
with open('/C:/Users/User/Desktop/conversation1.mp3', 'rb') as f:
dataList.append(f.read())
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=language;'))
dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))
dataList.append(encode("nl"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
'x-user-id': '6757f3ffb5e62f0ce0e513a2',
'x-api-key': '••••••',
'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/v1/stt/job", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('file', fs.createReadStream('/C:/Users/User/Desktop/conversation1.mp3'));
data.append('language', 'nl');
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://dev.api.betatel.com/api/v1/stt/job',
headers: {
'x-user-id': '6757f3ffb5e62f0ce0e513a2',
'x-api-key': '••••••',
...data.getHeaders()
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://dev.api.betatel.com/api/v1/stt/job',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('/C:/Users/User/Desktop/conversation1.mp3'),'language' => 'nl'),
CURLOPT_HTTPHEADER => array(
'x-user-id: 6757f3ffb5e62f0ce0e513a2',
'x-api-key: ••••••'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://dev.api.betatel.com/api/v1/stt/job")
.header("x-user-id", "6757f3ffb5e62f0ce0e513a2")
.header("x-api-key", "••••••")
.field("file", new File("/C:/Users/User/Desktop/conversation1.mp3"))
.field("language", "nl")
.asString();
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://dev.api.betatel.com/api/v1/stt/job");
request.Headers.Add("x-user-id", "6757f3ffb5e62f0ce0e513a2");
request.Headers.Add("x-api-key", "••••••");
var content = new MultipartFormDataContent();
content.Add(new StreamContent(File.OpenRead("/C:/Users/User/Desktop/conversation1.mp3")), "file", "/C:/Users/User/Desktop/conversation1.mp3");
content.Add(new StringContent("nl"), "language");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
JSON Schema:
🎉 Congratulations – Mission Accomplished!
You've just taken the first step toward automating transcription for your application.
🔜 What’s Next?
Test it
– Upload different files and fine-tune language support.Integrate it
– Seamlessly add this to your existing workflows.Expand it
– Explore our other APIs for even more automation magic. 🔧 Need assistance? Our support team is here to help!
✨ Happy transcribing!