Ads by Google

Infusionsoft SDK Contact Service

The contact service allows you to add, update and load contacts, as well as add/remove them from groups or campaigns, and run action sequences.

In the SDK you get access to the contact service functions by including the file “ContactService.php” in your code. Below is a list of the functions, their return values and the arguments they accept.

Function Description Return Value Arguments
Add Con Adds a contact record to Infusionsoft. Integer 1
UpdateCon Updates a contact in Infusionsoft. Integer 2
loadCon Loads a contact record from Infusionsoft. Array 2
grpAssign Assigns a contact to a group in Infusionsoft. Boolean 2
grpRemove Removes a contact from a group in Infusionsoft. Boolean 2
campAssing Assigns a contact to a campaign in Infusionsoft. Boolean 2
campRemove Removes a contact from a campaign in Infusionsoft. Boolean 2
campPause Pauses a campaign for a contact in Infusionsoft. Boolean 2
runAS Runs an Action Sequence/Action Set for a specific contact in Infusionsoft. Nested Array 2
getNextCampaignStep AReturns the id of the next unfinished step in the campaign for the given contact. Integer 2
rescheduleCampaignStep Reschedules a campaign step for a list of contacts. Integer 2

addCon( [array] Contact Data );
With the addcon function you can add contact records to the Infusionsoft database. This function is very straight forward, you will just need to create an associative array of the contact data and pass it as an argument to addCon(). addCon will then create the contact record and return the ID of the newly added contact. Below we have an example of this.

 

updateCon( [int] Contact ID, [array] Contact Data );

With the updateCon function to can update fields in a contact record (e.g. a contacts email address). To use this function you just need to create an associative array of the contact data you wish you update, and then call the function passing the contacts ID as the first argument and the array as the second. Below we have an example of how to use this function to update the contacts email address, in this example it is the contact with the ID 123.

updateCon will return an integer that is the ID of the contact you just updated. if the update fails an error will be returned.

loadCon( [int] Contact ID, [array] Return Fields );

With the loadCon function you can load data from a contacts fields. To do this you just need to specify the contacts ID and an array of the field names in which you wish to pull data from. When you run this function it will return an associative array back to you with the data you requested. Below we have an example of how to load some data from Contact ID 123.

If the function runs without any errors the returned data will look like:

 

grpAssign( [int] Contact ID, [int] Group ID );

With the grpAssign function you can easily add a contact to a group by passing the contact ID and group ID in the arguments of the function. grpAssign will return a boolean value to let you know if the actions succeeded(true) or failed(false). Below we have an example of using the grpAssign function:

 

grpRemove( [int] Contact ID, [int] Group ID );

With the grpRemove function you can easily remove a contact from a group by passing the contact ID and group ID in the arguments of the function. grpRemove will return a boolean value to let you know if the actions succeeded(true) or failed(false). Below we have an example of using the grpRemove function:

 

campAssign( [int] Contact ID, [int] Campaign ID );

With the campAssign function you can add a contact to a campaign by passing the contact ID and the campaign ID. campAssign will return a boolean value to inform you if the action was proccessed successfully or not. Below you will find an example on using the campAssign function:

 

campRemove( [int] Contact ID, [int] Campaign ID );

With the campRemove function you can remove a contact from a campaign by passing the contact ID and the campaign ID. campRemove will return a boolean value to inform you if the action was proccessed successfully or not. Below you will find an example on using the campRemove function:

 

campPause( [int] Contact ID, [int] Campaign ID );

With the campPause function you can pause a contacts campaign steps by passing the contact ID and the campaign ID. campPause will return a boolean value to inform you if the action was proccessed successfully or not. Below you will find an example on using the campPause function:

 

runAS( [int] Contact ID, [int] Action Set ID );

The runAS function allows you to run an “Action Set” on a contact record. Action Sets must be built out inside of Infusionsoft currently and then you can pass the ID of the Action Set to the function along with the contacts ID. The returned value is a nested array with details about each action in the set. Below is a sample of the function:

Below is an example of the returned array.

 

getNextCampaignStep( [int] contactId, [int] campaignId );

The getNextCampaignStep function will return back the next campaign step for a specified contact and campaign.

 

rescheduleCampaignStep([int array] contactIds, [int] campaignStepId);

The rescheduleCampaignStep function is used to reschedule a campaign step for a list of contacts. The return value is the number of the contacts that were successfully added.

 

Summary
Infusionsoft SDK Contact Service
Article Name
Infusionsoft SDK Contact Service
Description
The contact service allows you to add, update and load contacts, as well as add/remove them from groups or campaigns, and run action sequences.
Author
www.CreativForm.com