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.
See CreateContactList.
Request Parameters
Parameter | Demo Value | Description | Data Type |
---|---|---|---|
AddContactsToList | Add attached numbers to contact list | object | |
ContactListId | Unique ID of ContactList | long | |
Validate | Turn off list validation (default: true) | boolean | |
ContactSource | List of contacts, numbers, contactIds, or csv file. | object | |
Contact * | Info about the people you want to contact. Any info needed can be stored under Contact as an extra attribute. | object | |
mobilePhone | E.164 11 digit number | PhoneNumber | |
homePhone | E.164 11 digit number | PhoneNumber | |
extraPhone1 | E.164 11 digit number | PhoneNumber | |
externalSystem | System where externalId was generated from (NATION_BUILDER, GOOGLE_GROUPS, etc...) | string | |
zipcode | 5 digit zipcode | string | |
extraPhone2 | E.164 11 digit number | PhoneNumber | |
firstName | First name | string | |
lastName | Last name | string | |
extraPhone3 | E.164 11 digit number | PhoneNumber | |
externalId | id of contact defined by external system (NATION_BUILDER, GOOGLE_GROUPS, etc...) | string | |
id | Unique ID of Contact | long | |
workPhone | E.164 11 digit number | PhoneNumber | |
ContactId * | List of existing contact ids | List[long] | |
File * | Csv file attachment containing list of contacts or numbers | base64Binary | |
Numbers * | List of E.164 11 digit numbers space or comma seperated and optional fieldName | object | |
fieldName | field number should be assigned to homePhone, workPhone or mobilePhone (default: homePhone) | string |
* indicates choice value, bolded parameters are required
<?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'));
/**
* AddContactsToList. Currently only supports adding ContactSource numbers, not
* contact lists, contactId lists, or csv files.
*/
//
// Add contact numbers to existing contact list.
//
$request = new stdClass();
$request->ContactListId = 78; // long required
$request->ContactSource = new stdClass(); // required
$request->ContactSource->Numbers = array();
$request->ContactSource->Numbers['_'] = '3105551212 3105552121'; // required PhoneNumberList
$request->ContactSource->Numbers['fieldName'] = 'mobilePhone'; // string defaults to 'homePhone'
$client->AddContactsToList($request);
//
// Add contacts with fields filled in.
//
$request = new stdClass();
$request->ContactListId = 2; // long required
$request->ContactSource = new stdClass(); // required
$request->ContactSource->Contact = array();
$request->ContactSource->Contact[0]['firstName'] = "John";
$request->ContactSource->Contact[0]['lastName'] = "Doe";
$request->ContactSource->Contact[0]['mobilePhone'] = "13105551212";
$request->ContactSource->Contact[0]['homePhone'] = "13105551212";
$request->ContactSource->Contact[0]['workPhone'] = "13105551222";
$request->ContactSource->Contact[1]['firstName'] = "Jane";
$request->ContactSource->Contact[1]['lastName'] = "Doe";
$request->ContactSource->Contact[1]['mobilePhone'] = "13105552121";
$request->ContactSource->Contact[1]['homePhone'] = "13105552121";
$request->ContactSource->Contact[1]['workPhone'] = "13105552111";
$client->AddContactsToList($request);
?>