This service provides account holders the means to manage personal phonebook entries. Consumers can view, add or remove entries (numbers).

WSDL

The list service allows you to create and manage your phonebooks. The WSDL for which is available here: List Service WSDL.

Visuals

Methods

removeNumbersFromList

Use this function to remove numbers from your existing list.

Parameters

Name Max Occurs Min Occurs Nillable Type Description
key 1 1 TRUE xsd:string Unique key mapped to account to determine ownership
listid 1 1   xsd:long The ID associated with the list.
numbers 1 1 TRUE tns:ArrayOfString List of numbers to be removed

Example Request

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

  
    
      string
      -8540
      
        string
        string
      
    
  

Sample PHP Code

public function removeNumbersFromList($api_key,$listid,$phoneNumbers,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/ListService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
	$lines = file($phoneNumbers) or die('Unable to upload phone numbers');
	foreach($lines as $line)
	{
		$pnumber['string'][] = $line;
	}
	$removenumbers = array(
  		'key' => $api_key,
	'listid' => $listid,
	'numbers' => $pnumber
	);
	try
	{
		$removeNumbersFromListResponse = $campaignOutboundClient->removeNumbersFromList($removenumbers);
		if($debug)
		{
			echo "Numbers removed from list";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public void removeNumbersFromList(string key, ListDTO list, List numbers)
{
    LOG.Info("Entered removeNumbersFromList(string key, ListDTO list, List numbers)");

    /*
     * Validation of parameters early helps avoid runtime
     * exceptions such as null pointer exceptions (NPE). Invalid
     * parameters can be rejected immediately before any web
     * service calls are made.
     */
    this.validateAccountKey(key);
    this.validateList(list);
    this.validateNumbers(numbers);

    try
    {
        /*
         * Removes given numbers from a pre-existing list. The list id is used
         * to specify which list to remvoe the numbers from. The numbers list
         * is converted to an array as required by the web service proxy object.
         */
        this.listService.removeNumbersFromList(key, list.Id, numbers.ToArray());
    }
    catch (Exception e)
    {
        //write to log and raise exception indicating an error occurred
        string msg = "Unable to remove numbers from list";
        LOG.Error(msg);
        throw new ListServiceException(msg, e);
    }
    finally
    {
        LOG.Info("Exited removeNumbersFromList(string key, ListDTO list, List numbers)");
    }
}

removeNumberFromList

Use this function to remove a single number from your existing list.

Parameters

Name Required Description
key Y This is the key that you got when you registerd with CallFire.com
listid Y This is the id of your phone book list. You can access this by logging on to CallFire.com, then goto Toolbox -> Phonebooks and DNC
number Y This is the number that you wish to remove from the list

Sample PHP Code

public function removeNumberFromList($api_key,$listid,$number,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/ListService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$removelistparams = array(
  		'key' => $api_key,
	'listid' => $listid,
	'number' => $number
	);
	try
	{
		$removeNumberFromListResponse = $campaignOutboundClient->removeNumberFromList($removelistparams);
		if($debug)
		{
			echo "Number removed from list";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."";
		}
	}
}

Sample C# Code

public void removeNumberFromList(string key, ListDTO list, string number)
{
    LOG.Info("Entered removeNumberFromList(string key, ListDTO list, string number)");

    /*
     * Validation of parameters early helps avoid runtime
     * exceptions such as null pointer exceptions (NPE). Invalid
     * parameters can be rejected immediately before any web
     * service calls are made.
     */
    this.validateAccountKey(key);
    this.validateList(list);
    this.validateNumber(number);

    try
    {
        /*
         * Removes given number from a pre-existing list. The list id is used
         * to specify which list to remvoe the number from.
         */
        this.listService.removeNumberFromList(key, list.Id, number);
    }
    catch (Exception e)
    {
        //write to log and raise exception indicating an error occurred
        string msg = "Unable to remove number from list";
        LOG.Error(msg);
        throw new ListServiceException(msg, e);
    }
    finally
    {
        LOG.Info("Exited removeNumberFromList(string key, ListDTO list, string number)");
    }
}

addNumberToList

This operation will add the specified number to the account holders list.

Parameters

Name maxOccurs minOccurs nillable type description
key 1 1 TRUE xsd:string Unique key mapped to account to determine ownership
listid 1 1   xsd:long The ID associated with the list.
number 1 1 TRUE tns:ArrayOfString Number to be added to the list

Example Request

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

  
    
      string
      6455
      string
    
  

Sample PHP Code

public function addNumberToList($api_key,$listid,$number,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/ListService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$addnumbers = array(
  		'key' => $api_key,
	'listid' => $listid,
	'number' => $number
	);
	try
	{
		$addNumberToListResponse = $campaignOutboundClient->addNumberToList($addnumbers);
		if($debug)
		{
			echo "Number added";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."";
		}
	}
}

Sample C# Code

public void addNumberToList(string key, ListDTO list, string number)
{
    LOG.Info("Entered addNumberToList(string key, ListDTO list, string number)");

    /*
     * Validation of parameters early helps avoid runtime
     * exceptions such as null pointer exceptions (NPE). Invalid
     * parameters can be rejected immediately before any web
     * service calls are made.
     */
    this.validateAccountKey(key);
    this.validateList(list);
    this.validateNumber(number);

    try
    {
        /*
         * Adds given number to a pre-existing list. The list id is used
         * to specify which list to add the number to.
         */
        this.listService.addNumberToList(key, list.Id, number);
    }
    catch (Exception e)
    {
        //write to log and raise exception indicating an error occurred
        string msg = "Unable to add number to list";
        LOG.Error(msg);
        throw new ListServiceException(msg, e);
    }
    finally
    {
        LOG.Info("Exited addNumberToList(string key, ListDTO list, string number)");
    }
}

addNumbersToList

Use this function to add numbers to an existing list

Parameters

Name Required Description
key Y This is the key that you got when you registerd with CallFire.com
listid Y This is the id of your phone book list. You can access this by logging on to CallFire.com, then goto Toolbox -> Phonebooks and DNC
numbers Y This is the list of phone numbers that you wish to add to an existing list.

Sample PHP Code

public function addNumbersToList($api_key,$listid,$phoneNumbers,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/ListService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
	$lines = file($phoneNumbers) or die('Unable to upload phone numbers');
	foreach($lines as $line)
	{
		$pnumber['string'][] = $line;
	}
	$addNumbersToListparams = array(
  		'key' => $api_key,
	'listid' => $listid,
	'numbers' => $pnumber
	);
	try
	{
		$addNumbersToListResponse = $campaignOutboundClient->addNumbersToList($addNumbersToListparams);
		$result = $addNumbersToListResponse->out;
		if($debug)
		{
			echo "Numbers added to the list";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."";
		}
	}
}

addNumberToListWithEmail

Use this function to add a number to an existing list along with the email

Parameters

Name maxOccurs minOccurs nillable type description
key 1 1 TRUE xsd:string Unique key mapped to account to determine ownership
listid 1 1   xsd:long The ID associated with the list.
number 1 1 TRUE xsd:String Number to be added to the list
email 1 1 TRUE xsd:string TBA
provider 1 1 TRUE xsd:String Number to be added to the list

Example Request

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

  
    
      string
      3750
      string
      string
      string
    
  

Sample PHP Code

public function addNumberToListWithEmail($api_key,$listid,$number,$email,$provider,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/ListService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$addnumbers = array(
  		'key' => $api_key,
	'listid' => $listid,
	'number' => $number,
	'email' => $email,
	'provider' => $provider
	);
	try
	{
		$addNumberToListWithEmailResponse = $campaignOutboundClient->addNumberToListWithEmail($addnumbers);
		$result = $addNumberToListWithEmailResponse->out;
		if($debug)
		{
			echo "Numbers added successfully";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."";
		}
	}
}

Sample C# Code

public void addNumberToListWithEmail(string key, ListDTO list, string number, 
    string email, string provider)
{
    LOG.Info("Entered addNumberToListWithEmail(string key, ListDTO list, string number, "
        + "string email, string provider)");

    /*
     * Validation of parameters early helps avoid runtime
     * exceptions such as null pointer exceptions (NPE). Invalid
     * parameters can be rejected immediately before any web
     * service calls are made.
     */
    this.validateAccountKey(key);
    this.validateList(list);
    this.validateNumber(number);
    this.validateEmail(email);
    this.validateProvider(provider);

    try
    {
        /*
         * Adds given number to a pre-existing list. The list id is used
         * to specify which list to add the numbers to. The email and provider
         * information is also included with the phone number.
         */
        this.listService.addNumberToListWithEmail(key, list.Id, number, email, provider);
    }
    catch (Exception e)
    {
        //write to log and raise exception indicating an error occurred
        string msg = "Unable to add number to list with email";
        LOG.Error(msg);
        throw new ListServiceException(msg, e);
    }
    finally
    {
        LOG.Info("Exited addNumberToListWithEmail(string key, ListDTO list, string number, "
            + "string email, string provider)");
    }
}

getLists

Use this function to get all your phone number lists from CallFire.com

Parameters

Name maxOccurs minOccurs nillable type description
key 1 1 TRUE xsd:string Unique key mapped to account to determine ownership

Response - getListsResponse

Name maxOccurs minOccurs nillable type description
out 1 1 TRUE tns:ArrayOfNumberListType  

Example Request

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

  
    
      string
    
  

Sample PHP Code

public function getLists($api_key,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/ListService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$getlists = array(
  		'key' => $api_key
	);
	try
	{
		$getListsResponse = $campaignOutboundClient->getLists($getlists);
		$lists = $getListsResponse->out;
		if($debug)
		{
			echo "<table border=1><tr><td>id</td><td>name</td></tr>";
			foreach($lists->NumberListType as $line)
			{
				echo "<tr>";
				echo "<td>".$line->id."</td>";
				echo "<td>".$line->name."</td>";
				echo "</tr>";
			}
			echo "</table>";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."";
		}
	}
}

Sample C# Code

public List getLists(string key)
{
    LOG.Info("Entered getLists(string key)");

    /*
     * Validation of parameters early helps avoid runtime
     * exceptions such as null pointer exceptions (NPE). Invalid
     * parameters can be rejected immediately before any web
     * service calls are made.
     */
    this.validateAccountKey(key);

    try
    {
        //get lists using the web service proxy and providing the account key
        CFLS.NumberListType[] lists = this.listService.getLists(key);

        //create List collection to return back to calling code
        List listsFound = new List();

        //construct ListDTO objects based on data returned from the web service
        foreach (CFLS.NumberListType nlType in lists)
        {
            ListDTO list = new ListDTO(nlType.id, nlType.name);
            listsFound.Add(list);
        }

        /*
         * A quick check is performed to see if debug mode is enabled for logging.
         * This ensure the string parameter is not evaluated unless it is needed.
         */
        if (LOG.IsDebugEnabled)
        {
            LOG.Debug("Found " + listsFound.Count + " lists in getLists() for key: " + key);
        }

        return listsFound;
    }
    catch (Exception e)
    {
        //write to log and raise exception indicating an error occurred
        string msg = "Unable to get lists for key: " + key;
        LOG.Error(msg);
        throw new ListServiceException(msg, e);
    }
    finally
    {
        LOG.Info("Exited getLists(string key)");
    }
}

addList

Use this funciton to create a new phonebook list.

Parameters

Name maxOccurs minOccurs nillable type description
key 1 1 TRUE xsd:string Unique key mapped to account to determine ownership
name 1 1 TRUE xsd:string  

Response

Name maxOccurs minOccurs nillable type description
out 1 1 TRUE tns:ArrayOfNumberListType  

Example Request

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

  
    
      string
      string
    
  

Sample PHP Code

public function addList($api_key,$name,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/ListService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$addListparams = array(
  		'key' => $api_key,
	'name' => $name
	);
	try
	{
		$addlistResponse = $campaignOutboundClient->addList($addListparams);
		$listid = $addlistResponse->out;
		if($debug)
		{
			echo "The list id is : ".$listid;
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."";
		}
	}
}

Sample C# Code

public ListDTO addList(string key, string name)
{
    LOG.Info("Entered addList(string key, string name)");

    /*
     * Validation of parameters early helps avoid runtime
     * exceptions such as null pointer exceptions (NPE). Invalid
     * parameters can be rejected immediately before any web
     * service calls are made.
     */
    this.validateAccountKey(key);
    this.validateListName(name);

    try
    {
        /*
         * Creates a new list using account key and provide name.
         * The id is returned in a wrapped long object. The value 
         * property of that object is used to retrieve the actual
         * long value of the id.
         */
        long listId = this.listService.addList(key, name).Value;
        
        //the ListDTO object is used to encapsulate the list's data
        ListDTO list = new ListDTO(listId, name);

        /*
         * A quick check is performed to see if debug mode is enabled for logging.
         * This ensure the string parameter is not evaluated unless it is needed.
         */
        if (LOG.IsDebugEnabled)
        {
            LOG.Debug("New list created: " + list);
        }

        return list;
    }
    catch (Exception e)
    {
        //write to log and raise exception indicating an error occurred
        string msg = "Unable to add list";
        LOG.Error(msg);
        throw new ListServiceException(msg, e);
    }
    finally
    {
        LOG.Info("Exited addList(string key, string name)");
    }
}

clearList

Use this function to clear the contents of a an existing list.

Parameters

Name Required Description
key Y This is the key that you got when you registerd with CallFire.com
listid Y This is the id of the list which you wish to clear.

Sample PHP Code

public function clearList($api_key,$listid,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/ListService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$clearListparams = array(
  		'key' => $api_key,
	'listid' => $listid
	);
	try
	{
		$clearlistResponse = $campaignOutboundClient->clearList($clearListparams);
		if($debug)
		{
			echo "List contents have been cleared";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."";
		}
	}
}