Submit an audio file for transcription and analysis. Downloads the file, converts GSM to WAV if needed, saves to WAV/, then uploads to Callmetrik for processing.
Parameter Type Description
audioID required
string
Unique identifier for the audio file from your system
voicefileURL required
string (URL)
Publicly accessible URL to the audio file (.wav or .gsm)
audioSource required
enum
Source system identifier:
PBXdemo → sends as pbx to Callmetrik
CCDdemo → sends as ccd to Callmetrik
OmniCoredemo → sends as omnichannel to Callmetrik
api_key required
string
API key for the given audioSource. Can be passed as:
— POST body field: api_key=your_key
— HTTP header: X-API-Key: your_key
Manage keys at Admin Panel
cURL
PHP
Python
JavaScript
Node.js
Copy
curl -X POST https://projects.astcrm.com/voiceTranscription/api.php \
-H "X-API-Key: your_api_key_here" \
-d "audioID=4430" \
-d "voicefileURL=https://example.com/recordings/call-4430.wav" \
-d "audioSource=PBXdemo"
Copy
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://projects.astcrm.com/voiceTranscription/api.php',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'audioID' => '4430',
'voicefileURL' => 'https://example.com/recordings/call-4430.wav',
'audioSource' => 'PBXdemo',
]),
CURLOPT_HTTPHEADER => [
'X-API-Key: your_api_key_here',
],
]);
$response = curl_exec($curl);
curl_close($curl);
$data = json_decode($response, true);
print_r($data);
Copy
import requests
url = 'https://projects.astcrm.com/voiceTranscription/api.php'
headers = {
'X-API-Key': 'your_api_key_here'
}
data = {
'audioID': '4430',
'voicefileURL': 'https://example.com/recordings/call-4430.wav',
'audioSource': 'PBXdemo'
}
response = requests.post(url, data=data, headers=headers)
print(response.json())
Copy
const formData = new FormData();
formData.append('audioID', '4430');
formData.append('voicefileURL', 'https://example.com/recordings/call-4430.wav');
formData.append('audioSource', 'PBXdemo');
const response = await fetch(
'https://projects.astcrm.com/voiceTranscription/api.php',
{
method: 'POST',
headers: { 'X-API-Key': 'your_api_key_here' },
body: formData,
}
);
const data = await response.json();
console.log(data);
Copy
const https = require('https');
const querystring = require('querystring');
const postData = querystring.stringify({
audioID: '4430',
voicefileURL: 'https://example.com/recordings/call-4430.wav',
audioSource: 'PBXdemo',
});
const options = {
hostname: 'projects.astcrm.com',
path: '/voiceTranscription/api.php',
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(postData),
'X-API-Key': 'your_api_key_here',
},
};
const req = https.request(options, (res) => {
let body = '';
res.on('data', (chunk) => body += chunk);
res.on('end', () => console.log(JSON.parse(body)));
});
req.write(postData);
req.end();
Success Response (200)
{
"success": true,
"message": "Successfully processed 1 audio(s)",
"results": [
{
"audioID": "4430",
"transcription": "Hello, how can I help you...",
"language": "en"
}
]
}
Failure Response (from Callmetrik)
{
"success": false,
"message": "processed 0 audio(s), failed 1",
"error_code": "NO_SPEECH_DETECTED",
"results": [
{
"audioID": "4430",
"message": "No speech detected in the audio file",
"error_code": "NO_SPEECH_DETECTED"
}
]
}
405 Method Not Allowed — must use POST
400 Missing required parameter (audioID / voicefileURL / audioSource)
400 Invalid audioSource value
401 Missing api_key — not provided in body or header
403 Invalid or inactive API key for the given audioSource
502 Failed to download audio file from voicefileURL
500 GSM → WAV conversion failed (sox error)
502 Failed to reach Callmetrik API
Webhook endpoint called by Callmetrik when analysis is complete. Saves the result JSON, updates the database, and forwards the result to the appropriate internal server based on audioSource.
Parameter Type Description
Body required
JSON (raw)
Raw JSON body sent by Callmetrik. Must contain a results[] array with audioID field.
cURL
PHP
Python
JavaScript
Node.js
Copy
curl -X POST https://projects.astcrm.com/voiceTranscription/voiceTranscriptionWebhook.php \
-H "Content-Type: application/json" \
-d '{
"success": true,
"results": [{"audioID": "4430", "transcription": "Hello..."}]
}'
Copy
<?php
$payload = json_encode([
'success' => true,
'results' => [
['audioID' => '4430', 'transcription' => 'Hello...']
]
]);
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://projects.astcrm.com/voiceTranscription/voiceTranscriptionWebhook.php',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
]);
$response = curl_exec($curl);
curl_close($curl);
print_r(json_decode($response, true));
Copy
import requests
url = 'https://projects.astcrm.com/voiceTranscription/voiceTranscriptionWebhook.php'
payload = {
'success': True,
'results': [
{'audioID': '4430', 'transcription': 'Hello...'}
]
}
response = requests.post(url, json=payload)
print(response.json())
Copy
const response = await fetch(
'https://projects.astcrm.com/voiceTranscription/voiceTranscriptionWebhook.php',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
success: true,
results: [{ audioID: '4430', transcription: 'Hello...' }]
}),
}
);
const data = await response.json();
console.log(data);
Copy
const https = require('https');
const payload = JSON.stringify({
success: true,
results: [{ audioID: '4430', transcription: 'Hello...' }]
});
const options = {
hostname: 'projects.astcrm.com',
path: '/voiceTranscription/voiceTranscriptionWebhook.php',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(payload),
},
};
const req = https.request(options, (res) => {
let body = '';
res.on('data', (chunk) => body += chunk);
res.on('end', () => console.log(JSON.parse(body)));
});
req.write(payload);
req.end();
Example Payload from Callmetrik (Success)
{
"success": true,
"message": "Successfully processed 1 audio(s)",
"results": [
{
"audioID": "4430",
"transcription": "Hello, how can I help you today...",
"language": "en",
"duration": 42.3
}
]
}
Example Payload from Callmetrik (Failure)
{
"success": false,
"message": "Successfully processed 0 audio(s), failed 1",
"error_code": "NO_SPEECH_DETECTED",
"results": [
{
"audioID": "4430",
"message": "No speech detected in the audio file",
"error_code": "NO_SPEECH_DETECTED"
}
]
}
Forwarded to Internal Server (POST body)
id=4430&json_url=https://projects.astcrm.com/voiceTranscription/json_logs/voice_20260331_120000_abc123.json
Webhook Response
{
"status": "success",
"audioID": "4430",
"audioSource": "PBXdemo",
"filename": "voice_20260331_120000_abc123.json",
"json_url": "https://projects.astcrm.com/voiceTranscription/json_logs/voice_20260331_120000_abc123.json",
"forward_url": "http://10.0.10.162/astVlogger/analysis_json.php",
"forward_status": 200,
"forward_response": "{\"status\":true,\"message\":\"Successfully updated\"}",
"forward_error": null
}
400 Empty request body
200 Saved but no audioID found in results[]
200 No DB record found for audioID (not forwarded)
200 OmniCoredemo — forwarded to demo.astcrm.com