CallFire has a new API!
We are proud to announce the launch of our API 2.0! Learn more about our streamlined, transactional and broadcast APIs. This version of the API documentation will remain available for reference only. There will be no new development, only bug fixes. We highly recommend upgrading to our newer and more sophisticated documentation.
Recording from calls can be retrieved here using CallId / Name pair. Sounds may be given a name, unique within a call, in the IVR using the record tag and varname attribute. This allows them to be requested by name in this API.
Request Parameters
Parameter | Demo Value | Description | Data Type |
---|---|---|---|
GetRecordingData | RecordingData request by unique ID or CallId/Name Pair | object | |
CallId | Unique ID of call | long | |
Name | Name of sound data as defined in IVR | string | |
RecordingId * | Unique ID of recording | long | |
Format | Format of the returned recording.[WAV, MP3] | SoundFormat |
* indicates choice value, bolded parameters are required
Response Parameters
Parameter | Description | Data Type |
---|---|---|
RecordingData | Raw binary sound data | base64Binary |
<?php
/**
* You'll need your login/password pair when you create the SOAP client.
* Don't use the fake login/password provided here; it's just for show and
* won't work.
*/
$wsdl = "http://callfire.com/api/1.1/wsdl/callfire-service-http-soap12.wsdl";
$client = new SoapClient($wsdl, array(
'soap_version' => SOAP_1_2,
'login' => 'YourLoginId',
'password' => 'YourPassword'));
/**
* GetRecordingData. Retrieve record from call using Call ID / Name pair
* or using recording ID.
*/
$request = new stdclass();
$request->CallId = 550011; // long required
$request->Name = 'customerResponse'; // string required
$request->RecordingId = 9; // long required choice
$request->Format = 'MP3'; // SoundFormat [WAV, MP3]
$response = $client->GetRecordingData($request);
$byteCount = file_put_contents("another_returned_sound.mp3", $response);
echo "byteCount: " . $byteCount;
// Sample response:
// byteCount: 34751
?>