Contact
Contacts endpoint
API path: https://www.callfire.com/api/1.1/rest/contact
All api endpoints return response in XML format by default, to get response in JSON put .json at the end of API path.
Create contact list
- Method: POST
- Request URI: /contact/list
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:
+----------------------------+---------------------+
| Validation error | Resolution |
+----------------------------+---------------------+
| LIST_COLUMNS_UNMAPPED | USE_DEFAULT_COLUMNS |
+----------------------------+---------------------+
| LIST_HAS_DUPLICATE_NUMBERS | SCRUB |
+----------------------------+---------------------+
| LIST_HAS_DNC_CONTACTS | SCRUB |
+----------------------------+---------------------+
| LIST_HAS_CONTACT_CONFLICTS | MERGE |
+----------------------------+---------------------+
| LIST_HAS_INVALID_NUMBERS | SCRUB |
+----------------------------+---------------------+
Operation parameters
- Name - Name of contact list
- Validate - Turn off list validation (default: true)
- ContactId - List of existing contact ids
- File - Csv file attachment containing list of contacts or numbers
- Numbers - comma separated list of numbers
- Contact object - it's just a set of following fields:
- Contact[0][firstName]
- Contact[0][lastName]
- Contact[0][zipcode]
- Contact[0][homePhone]
- Contact[0][workPhone]
- Contact[0][mobilePhone]
- Contact[0][A] - custom attributes are mapped to A-Z columns, it works in the same way if we use csv file with custom columns
- Contact[0][...]
- Contact[0][Z]
- Contact[1][firstName]
- Contact[1][lastName]
- ... skip
- Contact[2][firstName]
Example how to create contact list from contacts
$ curl https://www.callfire.com/api/1.1/rest/contact/list.json \
-X POST \
-u login:password \
-d Name=Api contact list 1 \
-d Contact[0][firstName]=Alice \
-d Contact[0][lastName]=Moore \
-d Contact[0][zipcode]=12345 \
-d Contact[0][homePhone]=12345678901 \
-d Contact[0][workPhone]=12345678900 \
-d Contact[0][A]=custom_value_1 \
-d Contact[0][B]=custom value 2 \
-d Contact[1][firstName]=Bob \
-d Contact[1][lastName]=Schmidt \
-d Contact[1][homePhone]=12345678801 \
-d Contact[1][mobilePhone]=12345678800 \
-d Contact[2][firstName]=John \
-d Contact[2][homePhone]=12345677701
Example how to create contact list from csv file
contacts.csv file:
firstName,lastName,homePhone,workPhone,custom data1, custom data2
Alice,Moore,12345678901,12345678900,test value1, test value2
Bob,Schmidt,12345678999,12345678888,test value3, test value4
$ curl https://www.callfire.com/api/1.1/rest/contact/list.json \
-X POST \
-u login:password \
-F Name=Api contact list 2 \
-F File=@contacts.csv
Example response
response code - 201 Created
{
"ResourceReference": {
"Id":609951003,
"Location":"https://www.callfire.com/api/1.1/rest/contact/list/609951003"
}
}
Add contacts to existing contact list
- Method: POST
- Request URI: /contact/list/{id}/add
Add contacts to existing contact list identified by id, request has the same contact source as in CreateContactList operation.
Operation parameters
- Id - existing contact list id
- Validate - Turn off list validation (default: true)
- ContactId - List of existing contact ids
- File - Csv file attachment containing list of contacts or numbers
- Numbers - comma separated list of numbers
- Contact object - it's just a set of following fields:
- Contact[0][firstName]
- Contact[0][lastName]
- Contact[0][zipcode]
- Contact[0][homePhone]
- Contact[0][workPhone]
- Contact[0][mobilePhone]
- Contact[0][A] - custom attributes are mapped to A-Z columns, it works in the same way if we use csv file with custom columns
- Contact[0][...]
- Contact[0][Z]
- Contact[1][firstName]
- Contact[1][lastName]
- ... skip
- Contact[2][firstName]
Example request
$ curl https://www.callfire.com/api/1.1/rest/contact/list/609951003/add.json \
-u login:password \
-X POST \
-d Contact[0][firstName]=Jason \
-d Contact[0][lastName]=Mars \
-d Contact[0][homePhone]=12345578901 \
-d Contact[0][workPhone]=12345668900 \
-d Contact[0][A]=custom_value_1 \
-d Contact[0][B]=custom value 2
Example response
response code - 204 No content