SoundFile service

Contents

SoundFile Service

Description

This service provides you with the capability to upload, download, remove, update sound files from your callfire account.

WSDL

The list service allows you to . The WSDL for which is available here: SoundFile Service WSDL.


Methods

convertMp3OrWaveFile

Use this function to convert a Mp3 file or a Wave File.

Parameters

  • key - This is the key that you were provided when you registered with callfire.com. You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings".
  • fileData - Sound File contents
  • filenameIncludingExtension - Enter the file name that you wish to convert including the file extension (eg. myfile.wav or myfile.mp3)


Example Request
<?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>


Example Response

Sample PHP Code
	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."";
			}
		}
	}
Sample C# Code
        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)");
            }
        }

getSoundFile

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

  • key - This is the key that you were provided when you registered with callfire.com. You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings".
  • fileid - This is the sound file id. You can view this id by logging on to callfire.com & then goto Toolbox -> Sound Manager
Example Request
<?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>
Example Response

Sample PHP Code
	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."";
			}
		}
	}
Sample C# Code
        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)");
            }
        }

listExternalIdFiles

Example Request
<?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>

listFiles

Use this function to display a list of all the sound files from your callfire account

Parameters

  • key - This is the key that you were provided when you registered with callfire.com. You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings".
Example Request
<?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>
Example Response

Sample PHP Code
	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."";
			}
		}
	}
Sample C# Code
        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)");
            }
        }

removeFile

Use this function to remove a file sound from your callfire account.

Parameters

  • key - This is the key that you were provided when you registered with callfire.com. You can view your key by logging onto callfire.com & then go to "Settings -> Account Settings".
  • fileid - This is the file id that you wish to remove from callfire.com. You can view this id by logging onto callfire.com & then go to "Toolbox -> SoundManager"
Example Request
<?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>


Example Response

Sample PHP Code
	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."";
			}
		}
	}
Sample C# Code
        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)");
            }
        }

storeFile

Use this function to store a file on callfire.com

Parameters

  • key - This is the key that you were provided when you registered with callfire.com. You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings".
  • file - This is of type SoundFileDataType which contains:
  • a. data - contents of the new file.
  • b. description - give a description to the file
  • c. filename - the filename that you want to appear on callfire.com
  • d. userid - this is your account user id - CallFire will fill this for you - leave it blank
Example Request
<?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>
Example Response

Sample PHP Code
	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."";
			}
		}
	}
Sample C# Code
        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)");
            }
        }

storeFile1

Use this function to store a file on callfire.com

Parameters

  • key - This is the key that you were provided when you registered with callfire.com. You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings".
  • filename - Give a name to the file. The file will be stored with this name on callfire.com
  • description - Use this field to give a description about the file.
  • data - Contents of the file that you want to store
Example Request
<?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>
Example Response

Sample PHP Code
	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."";
			}
		}
	}
Sample C# Code
        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)");
            }
        }


updateFile

Use this function to update an existing file on callfire.com

Parameters

  • key - This is the key that you were provided when you registered with callfire.com. You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings".
  • fileid - This is the id of the file from your callfire account which you want to update.
  • file - These are the contents of the file that will replace the old file. This is of type SoundFileDataType which contains:
  • a. data - contents of the new file.
  • b. description - give a description to the file
  • c. filename - the name of the file that you want to appear on callfire.com
  • d. userid - this is your account user id - CallFire will fill this for you - leave it blank
Example Request
<?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>
Example Response

Sample PHP Code
	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."";
			}
		}
	}
Sample C# Code
        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)");
            }
        }