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.
Add contact list to account using 1 of 4 inputs: list of contacts, numbers string, list of contactIds, or csv file containing contacts or numbers. If more then one ContactSource specified then only load from 1 source with precedence as listed above.
On import contact lists go through seven system safeguards that check the accuracy of the list. For example, our system checks if a number is formatted correctly, is invalid, is duplicated in another contact list, or is on your Do Not Contact list. API calls have their default validation error resolutions set differently then the defaults set on the CallFire web site under Settings | List Validation. The API validation defaults are:
LIST_COLUMNS_UNMAPPED | Resolution USE_DEFAULT_COLUMNS |
LIST_HAS_DUPLICATE_NUMBERS | Resolution SCRUB |
LIST_HAS_DNC_CONTACTS | Resolution SCRUB |
LIST_HAS_CONTACT_CONFLICTS | Resolution MERGE |
LIST_HAS_INVALID_NUMBERS | Resolution SCRUB |
Request Parameters
Parameter | Demo Value | Description | Data Type |
---|---|---|---|
CreateContactList | Create ContactList using attached info | object | |
RequestId | Unique ID, used to de-dup requests and make sure request is not processed twice | anyURI | |
Name | Name of contact list | string | |
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
Response Parameters
Parameter | Description | Data Type |
---|---|---|
CreatedId | Unique ID of resource | long |
<?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'));
/**
* CreateContactList. Add contact list to account using 1 of 4 inputs: list of
* contacts, numbers, list of contactIds, or file.
*/
//
// First lets create contact list from list of contacts.
//
$request = new stdClass();
$request->Name = 'API created contact list from list of contacts'; // string required
$request->ContactSource = new stdclass(); // required
$request->ContactSource->Contact = array(); //required choice
$request->ContactSource->Contact[0] = new stdClass(); // object
$request->ContactSource->Contact[0]->firstName = 'John'; // string
$request->ContactSource->Contact[0]->lastName = 'Smith'; // string
$request->ContactSource->Contact[0]->mobilePhone = '3105551212'; // PhoneNumber
$request->ContactSource->Contact[1] = new stdClass(); // object
$request->ContactSource->Contact[1]->firstName = 'Jane'; // string
$request->ContactSource->Contact[1]->lastName = 'Doe'; // string
$request->ContactSource->Contact[1]->mobilePhone = '8185551212'; // PhoneNumber
$response = $client->CreateContactList($request);
print_r($response);
// Sample output:
// 24915001
//
// Create contact list from numbers.
//
$request = new stdClass();
$request->Name = 'API created contact list from numbers'; // string required
$request->ContactSource = new stdClass(); // required
$request->ContactSource->Numbers = array();
$request->ContactSource->Numbers['_'] = '3105551213 3105551213'; // required PhoneNumberList
$request->ContactSource->Numbers['fieldName'] = 'mobilePhone'; // string defaults to 'homePhone'
$response = $client->CreateContactList($request);
print_r($response);
// Sample output:
// 24915001
//
// Create contact list from list of contactIds.
//
$request = new stdClass();
$request->Name = 'API created contact list from contactIds'; // string required
$request->ContactSource = new stdClass(); // required
$request->ContactSource->ContactId = '2 3'; // required idList
$response = $client->CreateContactList($request);
print_r($response);
// Sample output:
// 24916001
//
// Create contact list from csv file with content like:
// firstName, lastName, mobilePhone
// John, Smith, 13105551215
// Jane, Doe, 18185551215
//
$request = new stdClass();
$request->Name = 'API created contact list from csv file'; // string required
$request->ContactSource = new stdClass(); // required
$request->ContactSource->File = stream_get_contents(fopen('Contacts.csv', 'rb')); // required base64Binary
$response = $client->CreateContactList($request);
print_r($response);
// Sample output:
// 24917001
?>