Audio Download
This service is used to download audio files of recorded calls. The name of the audio file is sent as a parameter in the CDR event to the web service.
Parameters
| Parameters | Required[**]/Logical[*] | Defined Data | Sample Data | Description |
|---|---|---|---|---|
| file | ** | - | 20200921_1600675211.10033.1 | The name of the call recording file obtained from the search |
** The audio file is sent in the response for download to the web service. **
Sample Invocation
Example Code
PHP
<?PHP
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'HTTP://192.168.1.100/API/v4/reports/audio/download',
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 =>'{
"file":"20200921_1600675211.10033.1.mp3"
}',
CURLOPT_HTTPHEADER => array(
'X-APIKEY: SAMPLE_API_KEY',
'Authorization: Basic c2FkcjpTYWRyQDEyMw==',
'Content-Type: application/JSON'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>JavaScript
<html>
<head>
<script src="/wiki/assets/vendor/jquery/jquery.min.js"></script>
</head>
<body>
<script>
var settings = {
"URL": "HTTP://192.168.1.100/API/v4/reports/audio/download",
"method": "POST",
"timeout": 0,
"headers": {
"X-APIKEY": "9UV0BWKRL83PYIH9Gv1fI85d41lO4S932EeX3wHC47sHjMJOMG",
"Authorization": "Basic c2FkcjpTYWRyQDEyMw==",
"Content-Type": "application/JSON"
},
"data": JSON.stringify({
"file": "20200921_1600675211.10033.1.mp3"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
</script>
</body>
</html>cURL
curl --location --request POST 'HTTP://192.168.1.100/API/v4/reports/audio/download' \
--header 'X-APIKEY: SAMPLE_API_KEY' \
--header 'Authorization: Basic c2FkcjpTYWRyQDEyMw==' \
--header 'Content-Type: application/JSON' \
--data-raw '{
"file":"20200921_1600675211.10033.1.mp3"
}'