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.
Returns the raw binary data in specified format from specified sound. If no format is specified will return MP3 data.
Request Parameters
Parameter | Demo Value | Description | Data Type |
---|---|---|---|
GetSoundData | SoundData request by unique ID | object | |
Id | Unique ID of resource | long | |
Format | Specifies the format of the returned sound data.[WAV, MP3] | SoundFormat |
* indicates choice value, bolded parameters are required
Response Parameters
Parameter | Description | Data Type |
---|---|---|
SoundData | SoundData as application/octet-stream | 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'));
/**
* GetSoundData. Get raw binary sound data (MP3 or WAV) for stored sound asset.
*/
$request = new stdclass();
$request->Id = 9; // long required
$request->Format = 'MP3'; // SoundFormat [WAV, MP3]
$response = $client->GetSoundData($request);
$byteCount = file_put_contents("my_returned_sound.mp3", $response);
echo "byteCount: " . $byteCount;
// Sample response:
// byteCount: 22749
?>