Skip to main content

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

Parameter nameRequiredDescription
keyYThis 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".
fileDataYSound File contents
filenameIncludingExtensionYEnter 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"?>

  
    
      string
      YTM0NZomIzI2OTsmIzM0NTueYQ==
      string
    
  

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

Parameter nameRequiredDescription
keyYThis 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".
fileidYThis 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"?>

  
    
      string
      5192
    
  

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"?>

  
    
      string
      -1356
    
  

listFiles

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

Parameters

Parameter nameRequiredDescription
keyYThis 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"?>

  
    
      string
    
  

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

Parameter nameRequiredDescription
keyYThis 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".
fileidYThis 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"?>

  
    
      string
      8706
    
  

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

Parameter nameRequiredDescription
keyYThis 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".
fileYThis 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"?>

  
    
      string
      
        YTM0NZomIzI2OTsmIzM0NTueYQ==
        string
        string
        
      
    
  

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

Parameter nameRequiredDescription
keyYThis 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".
filenameYGive a name to the file. The file will be stored with this name on callfire.com
descriptionYUse this field to give a description about the file.
dataYContents of the file that you want to store

Example Request

<?xml version="1.0" encoding="utf-8"?>

  
    
      string
      string
      string
      YTM0NZomIzI2OTsmIzM0NTueYQ==
    
  

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

Parameter nameRequiredDescription
keyYThis 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".
fileidYThis is the id of the file from your callfire account which you want to update.
fileYThis 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"?>

  
    
      string
      -8585
      
        YTM0NZomIzI2OTsmIzM0NTueYQ==
        string
        string
        
      
    
  

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)");
    }
}