ContactService is used to manage contacts. You can add, update and find contacts in addition to managing follow up sequences, tags and action sets.
Creates a new contact record from the data passed in the associative array
Parameter Name | Type | Definition |
---|---|---|
Key | string | Your Infusionsoft API key |
data | array | an associative array of the data for this new contact record. The array key is the field name to store the value within |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>ContactService.add</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><struct> <member><name>FirstName</name> <value><string>John</string></value> </member> <member><name>LastName</name> <value><string>Doe</string></value> </member> <member><name>Email</name> <value><string>there_he_go@itsjohndoe.com</string></value> </member> </struct></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value><i4>contactIDNumber</i4></value> </param> </params> </methodResponse>
$conDat = array('FirstName' => 'John', 'LastName' => 'Doe', 'Email' => 'JDoe@email.com'); $conID = $app->addCon($conDat);
Merge two contacts together
Parameter Name | Type | Definition |
---|---|---|
privateKey | string | Your Infusionsoft API key |
contactId | int | the contact Id number you want to merge |
duplicateContactId | int | the Id of the duplicate contact you would like to merge |
<?xml version="1.0"?> <methodCall> <methodName>ContactService.merge</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>contactId</int></value> </param> <param> <value><int>duplicateContactId</int></value> </param> </params> </methodCall>
<?xml version="1.0" encoding="UTF-8"?> <methodResponse> <params> <param> <value> <boolean>1</boolean> </value> </param> </params> </methodResponse>
$carray = array( php_xmlrpc_encode($app->key), php_xmlrpc_encode(16), php_xmlrpc_encode(24)); $app->methodCaller("ContactService.merge",$carray);
Adds a contact to a follow-up sequence (campaigns were the original name of follow-up sequences)
Parameter Name | Type | Definition |
---|---|---|
Key | string | Your Infusionsoft API key |
contactId | int | the contact Id number you would like to start the follow-up sequence for |
campaignId | int | the Id number of the follow-up sequence you would like to start |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>ContactService.addToCampaign</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>contactIDNumber</int></value> </param> <param> <value><int>campaignIDNumber</int></value> </param> </params> </methodCall>
<?xml version="1.0" encoding="UTF-8"?> <methodResponse> <params> <param> <value> <boolean>0</boolean> </value> </param> </params> </methodResponse>
$contactId = 123; $campId = 456; $result = $app->campAssign($contactId, $campId)
Adds a tag to a contact record
Parameter Name | Type | Definition |
---|---|---|
Key | string | Your Infusionsoft API key |
contactId | int | the contact Id number you would like to add to a group |
groupId | int | the Id number of the group you wish to add the contact to |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>ContactService.addToGroup</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>contactIDNumber</int></value> </param> <param> <value><int>groupIDNumber</int></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value><boolean>0</boolean></value> </param> </params> </methodResponse>
$contactId = 123; $groupId = 456; $result = $app->grpAssign($contactId, $groupId);
Returns the Id number of the next follow-up sequence step for the given contact
Parameter Name | Type | Definition |
---|---|---|
Key | string | Your Infusionsoft API key |
contactId | int | the Id number of the contact record you would like to get the next sequence step for |
followUpSequenceId | int | the follow-up sequence Id number you would like to get the next step for the given contact |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>ContactService.getNextCampaignStep</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>contactIDNumber</int></value> </param> <param> <value><int>followUpSequenceId</int></value> </param> </params> </methodCall>
no response made yet
$cStep = $app->getNextCampaignStep($contactIdNumber,2);
Finds all contacts with the given email address. This searches the Email, Email 2, and Email 3 fields
Parameter Name | Type | Definition |
---|---|---|
Key | string | Your Infusionsoft API key |
The email address to search contacts by | ||
selectedFields | array | The contact fields you would like returned |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>ContactService.findByEmail</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><string>there_he_go@itsjohndoe.com</string></value> </param> <param> <value><array> <data> <value><string>Id</string></value> <value><string>FirstName</string></value> <value><string>LastName</string></value> </data> </array></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value> <array> <data> <value> <struct> <member> <name>FirstName</name> <value>John</value> </member> <member> <name>Id</name> <value><i4>16</i4></value> </member> <member> <name>LastName</name> <value>Doe</value> </member> </struct> </value> <value> <struct> <member> <name>FirstName</name> <value>Ron</value> </member> <member> <name>Id</name> <value><i4>18</i4></value> </member> <member> <name>LastName</name> <value>Doe</value> </member> </struct> </value> </data> </array> </value> </param> </params> </methodResponse>
$email = 'test@example.com'; $returnFields = array('Id', 'FirstName', 'LastName'); $data = $app->findByEmail($email, $returnFields);
Load data from a specific contact record
Parameter Name | Type | Definition |
---|---|---|
Key | string | Your Infusionsoft API key |
contactId | int | The Id number of the contact you would like to load data from |
selectedFields | array | An array of strings where each string is the database field name of the field you would like sent back |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>ContactService.load</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>contactIDNumber</int></value> </param> <param> <value><array> <data> <value><string>Id</string></value> <value><string>FirstName</string></value> <value><string>LastName</string></value> </data> </array></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value> <struct> <member> <name>FirstName</name> <value>Ron</value> </member> <member> <name>Id</name> <value><i4>18</i4></value> </member> <member> <name>LastName</name> <value>Doe</value> </member> </struct> </value> </param> </params> </methodResponse>
$returnFields = array('Email', 'FirstName', 'LastName', '_myCustomField'); $conDat = $app->loadCon(123, $returnFields);
Pauses a follow-up sequence for the given contact record
Parameter Name | Type | Definition |
---|---|---|
Key | string | Your Infusionsoft API key |
contactId | int | The Id number of the contact record you are pausing the sequence on |
sequenceId | int | The follow-up sequence Id number |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>ContactService.pauseCampaign</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>22</int></value> </param> <param> <value><int>2</int></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value> <boolean> 1 </boolean> </value> </param> </params> </methodResponse>
$contactId = 123; $seqId = 456; $result = $app->campPause($contactId, $seqId);
Removes a follow-up sequence from a contact record
Parameter Name | Type | Definition |
---|---|---|
Key | string | Your Infusionsoft API key |
contactId | int | The Id number of the contact you want to remove the sequence from |
followUpSequenceId | int | The Id number of the sequence you would like to remove the contact from |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>ContactService.removeFromCampaign</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>contactIDNumber</int></value> </param> <param> <value><int>campaignIDNumber</int></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value> <boolean> 1 </boolean> </value> </param> </params> </methodResponse>
$contactId = 123; $fusId = 456; $result = $app->campRemove($contactId, $fusId);
Removes a tag from a contact (groups were the original name of tags)
Parameter Name | Type | Definition |
---|---|---|
Key | string | Your Infusionsoft API key |
contactId | int | The Id number of the contact you would like to remove the tag from |
TagId | int | The tag Id number. This is found on the Setup->Tags menu |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>ContactService.removeFromGroup</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>contactIDNumber</int></value> </param> <param> <value><int>groupIDNumber</int></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value><boolean>0</boolean></value> </param> </params> </methodResponse>
$contactId = 123; $groupId = 456; $result = $app->grpRemove($contactId, $groupId);
Resumes a follow-up sequence that has been stopped/paused for a given contact
Parameter Name | Type | Definition |
---|---|---|
privateKey | string | Your Infusionsoft API key |
contactId | int | The Id number of the contact you would like to remove the tag from |
seqId | int | The follow-up sequence Id number |
<?xml version='1.0' encoding='UTF-8'?>
<?xml version='1.0' encoding='UTF-8'?>
$contactId = 123; $groupId = 456; $result = $app->grpRemove($contactId, $groupId);
Immediately performs the given follow-up sequence stepId for the given contacts
Parameter Name | Type | Definition |
---|---|---|
privateKey | string | Your Infusionsoft API key |
contactIds | array | An array of contact Id numbers you would like to reschedule the step for |
sequenceStepId | int | The Id number of the particular sequence step you would like to reschedule |
<?xml version="1.0"?> <methodCall> <methodName>ContactService.rescheduleCampaignStep</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><array> <data> <value><int>22</int></value> <value><int>12</int></value> <value><int>16</int></value> </data> </array></value> </param> <param> <value><int>2</int></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value> <i4> 3 </i4> </value> </param> </params> </methodResponse>
$conIds = array(123,456,789); $numCons = $app->rescheduleCampaignStep($conIds, 23);
Removes a tag from a contact (groups were the original name of tags)
Parameter Name | Type | Definition |
---|---|---|
privateKey | string | Your Infusionsoft API key |
contactId | int | The Id number of the contact you would like to remove the tag from |
tagId | int | The tag Id number. This is found on the Setup->Tags menu |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>ContactService.removeFromGroup</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>contactIDNumber</int></value> </param> <param> <value><int>groupIDNumber</int></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value><boolean>0</boolean></value> </param> </params> </methodResponse>
$contactId = 123; $groupId = 456; $result = $app->grpRemove($contactId, $groupId);
Runs an action set on a given contact record
Parameter Name | Type | Definition |
---|---|---|
privateKey | string | Your Infusionsoft API key |
contactId | int | The Id number of the contact record you want to run the action set on |
actionSetId | int | The Id number of the action set you would like to run. This is found on the Setup->Action sets menu |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>ContactService.runActionSequence</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>contactIDNumber</int></value> </param> <param> <value><int>1</int></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value> <array> <data> <value> <struct> <member> <name> Action </name> <value> Apply/Remove Tag </value> </member> <member> <name> Message </name> <value> tags applied to Contact: Nurture Subscriber </value> </member> <member> <name> IsError </name> <value> <boolean> 0 </boolean> </value> </member> </struct> </value> </data> </array> </value> </param> </params> </methodResponse>
$contactId = 123; $actionId = 456; $result = $app->runAS($contactId, $actionId);
Adds or updates a contact record based on matching data
Parameter Name | Type | Definition |
---|---|---|
privateKey | string | Your Infusionsoft API key |
data | array | An associative array of the data for this new contact record. The array key is the field name to store the value within |
dupCheckType | string | Determines how to consider a duplicate record. Options: 'Email', 'EmailAndName', 'EmailAndNameAndCompany' |
<?xml version="1.0"?> <methodCall> <methodName>ContactService.addWithDupCheck</methodName> <params> <param> <value><string>c94a1f2b395a9ab97d4263b37f7b0923</string></value> </param> <param> <value> <struct> <member> <name>FirstName</name> <value><string>mytest</string></value> </member> <member> <name>LastName</name> <value><string>duh</string></value> </member> <member> <name>Email</name> <value><string>me@testingthis.com</string></value> </member> </struct> </value> </param> <param> <value><string>EmailAndName</string></value> </param> </params> </methodCall>
<?xml version="1.0" encoding="UTF-8"?> <methodResponse> <params> <param> <value> <i4>40</i4> </value> </param> </params> </methodResponse>
$app->addWithDupCheck(array('FirstName' => 'test', 'LastName' => 'test', 'Email' => 'test@test.com'), 'EmailAndName');
Updates the data on a contact record
Parameter Name | Type | Definition |
---|---|---|
privateKey | string | Your Infusionsoft API key |
contactId | int | The Id number of the contact you wish to update |
data | array | An associate array of the data for this contact. The array key needs to be the field name in which you store the value |
<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>ContactService.update</methodName> <params> <param> <value><string>privateKey</string></value> </param> <param> <value><int>contactIDNumber</int></value> </param> <param> <value><struct> <member><name>fieldToUpdate1</name> <value><string>field1</string></value> </member> <member><name>fieldToUpdate2</name> <value><string>field2</string></value> </member> </struct></value> </param> </params> </methodCall>
<?xml version='1.0' encoding='UTF-8'?> <methodResponse> <params> <param> <value><i4>contactIDNumber</i4></value> </param> </params> </methodResponse>
$conDat = array('Email' => 'JDoe2@email.com'); $conID = $app->updateCon(123, $conDat);