The workflow to create a recording is:
[
{
"action": "record",
"eventUrl": "https://example.com/recording",
"format": "mp3",
},
{
"action": "connect",
"from": {
"type": "internal",
"number": "phone_number_1",
"alias": "phone_number_1"
},
"to": {
"type": "external",
"number": "phone_number_2",
"alias": "phone_number_2",
}
}]
By default audio is recorded in mp3 format. Options are: mp3, wav
{
"start_time": "1522657810286",
"end_time": "1522657821413",
"recording_url": "https://api.stringee.com/v1/call/recording/call-vn-1-7J19KD86GD-1522657804684",
"call_id": "call-vn-1-7J19KD86GD-1522657804684",
"project_id": 25,
"type": "recording",
"recordMessage": false
}
<?php
// This will use the Stringee client library
include_once './StringeeApi/StringeeCurlClient.php';
//
$keySid = 'YOUR_KEYSID';
$keySecret = 'YOUR_KEYSECRET';
$curlClient = new StringeeCurlClient($keySid, $keySecret);
// the recording_url parameter from the recording event
$recording = 'RECORDING_URL';
$res = $curlClient->get($recording,15);
$content = $res->getContent();
header('Content-Type: Content-Type: application/octet-stream');
header("Content-disposition: attachment; filename=recoding.wav");
echo $content;
or
curl RECORDING_URL -H "X-STRINGEE-AUTH: ACCESS_TOKEN" -H "Content-Type: application/json" --output record.mp3
Note: After your recording is complete, it is stored by Stringee for 30 days.