Contents |
This service provides you with the capability to upload, download, remove, update sound files from your callfire account.
The list service allows you to . The WSDL for which is available here: SoundFile Service WSDL.
Use this function to convert a Mp3 file or a Wave File.
Parameters
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<tnsa:convertMp3OrWaveFile
xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.soundfile.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:key>string</tnsa:key>
<tnsa:fileData>YTM0NZomIzI2OTsmIzM0NTueYQ==</tnsa:fileData>
<tnsa:filenameIncludingExtension>string</tnsa:filenameIncludingExtension>
</tnsa:convertMp3OrWaveFile>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function convertMp3OrWaveFile($api_key,$la_file,$fname,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/SoundFileService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$handle = fopen($la_file,'r');
$contents = fread($handle,filesize($la_file));
$lafile = $contents;
$convertfileParams = array(
'key' => $api_key,
'fileData' => $lafile,
'filenameIncludingExtension' => $fname
);
try
{
$convertFileReponse = $campaignOutboundClient->convertMp3OrWaveFile($convertfileParams);
$fileid = $convertFileReponse->out;
if($debug)
{
echo "Converted Sound File ID is :: ".$fileid;
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public long convertMp3OrWaveFile(string key, byte[] fileData, string filenameIncludingExtension)
{
//LOG.Info("Entered convertMp3OrWaveFile(string key,byte[] fileData,string filenameIncludingExtension)");
try
{
long soundFileId = this.soundFileService.convertMp3OrWaveFile(key, fileData, filenameIncludingExtension);
return soundFileId;
}
catch (Exception e)
{
string msg = "Unable to do the conversion";
LOG.Error(msg);
throw new SoundFileServiceException(msg, e);
}
finally
{
//LOG.Info("Exited convertMp3OrWaveFile(string key,byte[] fileData,string filenameIncludingExtension)");
}
}
Use this function to get the contents of a sound file from your callfire account. i.e Download a file from your callfire account.
Parameters
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<tnsa:getSoundFile
xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.soundfile.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:key>string</tnsa:key>
<tnsa:fileid>5192</tnsa:fileid>
</tnsa:getSoundFile>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function getSoundFile($api_key,$file_id,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/SoundFileService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$soundfileparams = array(
'key' => $api_key,
'fileid' => $file_id
);
try
{
$soundFileResponse = $campaignOutboundClient->getSoundFile($soundfileparams);
$contents = $soundFileResponse->out;
if($debug)
{
//Save the contents on your local hard-drive.
$handle = fopen('filename.wav','w');
fwrite($handle,$contents);
fclose($handle);
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public byte[] getSoundFile(string key, long fileid)
{
//LOG.Info("Entered getSoundFile(string key, long fileid)");
try
{
byte[] SoundFile = this.soundFileService.getSoundFile(key, fileid);
return SoundFile;
}
catch (Exception e)
{
string msg = "Unable to getSoundFile";
LOG.Error(msg);
throw new SoundFileServiceException(msg, e);
}
finally
{
//LOG.Info("Exited getSoundFile(string key, long fileid)");
}
}
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<tnsa:listExternalIdFiles xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.soundfile.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:key>string</tnsa:key>
<tnsa:externalid>-1356</tnsa:externalid>
</tnsa:listExternalIdFiles>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Use this function to display a list of all the sound files from your callfire account
Parameters
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<tnsa:listFiles xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.soundfile.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:key>string</tnsa:key>
</tnsa:listFiles>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function listFiles($api_key,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/SoundFileService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$listfilesparams = array(
'key' => $api_key
);
try
{
$listfilesResponse = $campaignOutboundClient->listFiles($listfilesparams);
$listfiles = $listfilesResponse->out;
if($debug)
{
echo "<table border=1><tr><td>description</td><td>filename</td><td>id</td></tr>";
foreach($listfiles->SoundFileDescriptionType as $line)
{
echo "<tr>";
echo "<td>".$line->description."</td>";
echo "<td>".$line->filename."</td>";
echo "<td>".$line->id."</td>";
echo "</tr>";
}
echo "</table>";
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public SoundFileDescriptionType[] listFiles(string key)
{
//LOG.Info("Entered SoundFileDescriptionType[] listFiles(string key)");
try
{
SoundFileDescriptionType[] soundFileList = this.soundFileService.listFiles(key);
return soundFileList;
}
catch (Exception e)
{
string msg = "Unable to listFile";
LOG.Error(msg);
throw new SoundFileServiceException(msg, e);
}
finally
{
//LOG.Info("Exited SoundFileDescriptionType[] listFiles(string key)");
}
}
Use this function to remove a file sound from your callfire account.
Parameters
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<tnsa:removeFile xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.soundfile.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:key>string</tnsa:key>
<tnsa:fileid>8706</tnsa:fileid>
</tnsa:removeFile>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function removeFile($api_key,$file_id,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/SoundFileService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$removefileparams = array(
'key' => $api_key,
'fileid' => $file_id
);
try
{
$removefileResponse = $campaignOutboundClient->removeFile($removefileparams);
if($debug)
{
echo "File removed";
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public void removeFile(string key, long fileid)
{
//LOG.Info("Entered removeFile(string key,long fileid)");
try
{
this.soundFileService.removeFile(key, fileid);
}
catch (Exception e)
{
string msg = "Unable to removeFile";
LOG.Error(msg);
throw new SoundFileServiceException(msg, e);
}
finally
{
//LOG.Info("Exited removeFile(string key,long fileid)");
}
}
Use this function to store a file on callfire.com
Parameters
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<tnsa:storeFile xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.soundfile.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:key>string</tnsa:key>
<tnsa:file>
<tnsa:data>YTM0NZomIzI2OTsmIzM0NTueYQ==</tnsa:data>
<tnsa:description>string</tnsa:description>
<tnsa:filename>string</tnsa:filename>
<tnsa:userid></tnsa:userid>
</tnsa:file>
</tnsa:storeFile>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function storeFile($api_key,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/SoundFileService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$handle = fopen($file,'r');
$contents = fread($handle,filesize($file));
$filecontents = $contents;
//SoundFileDataType
$soundfiletype = new SoundFileDataType($filecontents,'file description','filename.wav',32182);
$storeFileParams = array(
'key' => $api_key,
'file' => $soundfiletype
);
try
{
$storeFileReponse = $campaignOutboundClient->storeFile($storeFileParams);
if($debug)
{
echo "File Stored on callfire.com";
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public void storeFile(string key, SoundFileDataType file)
{
//LOG.Info("Entered storeFile(string key, SoundFileDataType file)");
try
{
this.soundFileService.storeFile(key, file);
}
catch (Exception e)
{
string msg = "Unable to storeFile";
LOG.Error(msg);
throw new SoundFileServiceException(msg, e);
}
finally
{
//LOG.Info("Exited storeFile(string key, SoundFileDataType file)");
}
}
Use this function to store a file on callfire.com
Parameters
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<tnsa:storeFile1 xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.soundfile.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:key>string</tnsa:key>
<tnsa:filename>string</tnsa:filename>
<tnsa:description>string</tnsa:description>
<tnsa:data>YTM0NZomIzI2OTsmIzM0NTueYQ==</tnsa:data>
</tnsa:storeFile1>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function storeFile1($api_key,$file_name,$desc,$file,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/SoundFileService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$handle = fopen($file,'r');
$contents = fread($handle,filesize($file));
$filecontents = $contents;
$storeFileParams = array(
'key' => $api_key,
'filename' => $file_name,
'description' => $desc,
'data' => $filecontents
);
try
{
$storeFileReponse = $campaignOutboundClient->storeFile1($storeFileParams);
if($debug)
{
echo "File Stored on callfire.com";
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public void storeFile1(string key, string filename, string description, byte[] data)
{
//LOG.Info("Entered storeFile1(string key, string filename, string description, byte[] data)");
try
{
this.soundFileService.storeFile1(key, filename, description, data);
}
catch (Exception e)
{
string msg = "Unable to storeFile1";
LOG.Error(msg);
throw new SoundFileServiceException(msg, e);
}
finally
{
//LOG.Info("Exited storeFile1(string key, string filename, string description, byte[] data)");
}
}
Use this function to update an existing file on callfire.com
Parameters
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<tnsa:updateFile xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.soundfile.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:key>string</tnsa:key>
<tnsa:fileid>-8585</tnsa:fileid>
<tnsa:file>
<tnsa:data>YTM0NZomIzI2OTsmIzM0NTueYQ==</tnsa:data>
<tnsa:description>string</tnsa:description>
<tnsa:filename>string</tnsa:filename>
<tnsa:userid></tnsa:userid>
</tnsa:file>
</tnsa:updateFile>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function updateFile($api_key,$file_id,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/SoundFileService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$handle = fopen('live_file.wav','r');
$contents = fread($handle,filesize('live_file.wav'));
$lafile = $contents;
$soundfiletype = new SoundFileDataType($lafile,'file description','filename.wav',32182);
$createcampaign = array(
'key' => $api_key,
'fileid' => $file_id,
'file' => $soundfiletype
);
try
{
$createUserRespopnse = $campaignOutboundClient->updateFile($createcampaign);
$campaignId = $createUserRespopnse->out;
if($debug)
{
echo "File Updated";
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public void updateFile(string key, long fileid, SoundFileDataType file)
{
//LOG.Info("Entered updateFile(string key,long fileid, SoundFileDataType file)");
try
{
this.soundFileService.updateFile(key, fileid, file);
}
catch (Exception e)
{
string msg = "Unable to updateFile";
LOG.Error(msg);
throw new SoundFileServiceException(msg, e);
}
finally
{
//LOG.Info("Exited updateFile(string key,long fileid, SoundFileDataType file)");
}
}
