Working With The Infusionsoft API

In this article I am just going to cover the basic concepts for the Infusionsoft API, if you need to review the documentation, you can find it here:  http://help.infusionsoft.com/developers/api-basics.

Over the past 2 years my company project Take It National has been integrated tightly with Infusionsoft.  We are planning on adding more integrations to the new Take It National software, when it is ready for the Infusionsoft Market Place.  Basically as a software developer I had a few challenges integrating Infusionsoft with my product.  The docs have gotten better over the past 2 years, but originally it was a difficult road.   The big question is why all the integration.

Why Content?

What I have come to realize about any email or CRM company and any company that is Saas, is that there is often a missing component.  In the case of Take It National, the component that we take care of are events, content, geography and people management.  This means that we allow users to create events or content, mainly in the form of event data, but it could be other data, and that gets populated into the Infusionsoft outgoing emails.  What is so important about content?  Well, first off if you were going to send out an email about 10 different cities and you wanted specialized or personalized data for each person, you would have to create 10 separate templates for emails in Infusionsoft. There is a lot of copying and pasting.  Now try 75 separate cities you are trying to email each week from within Infusionsoft.  Stop Now!  It’s not that it can’t be done, the question is how to automate it all!

Geography and Segments

So, we started by integrating our emails from Take It National to Infusionsoft.  That task meant simply working with the provided Infusionsoft SDK or sample PHP code and making sure we ran the right API call for the right transactions.  Right now we send to over 70 cities with specialty emails through a two click process.  Our power users in Take It National look over the event content and make sure it’s right and then send.  So we are simply broadcasting and sending through the Infusionsoft Send API.

First Things First

So the first place we run an Infusionsoft API is when people fill out our forms on our websites.  We use a two step process where users typically will fill out a short form when runs a check to see if they are in Infusionsoft through their query API:

$contactinfo = $Infusion->dsQuery(“Contact”,10,0,$query,$returnFields);

Once we know they are not in the Infusionsoft contact list, we then run an addCon() function:

$conID=$Infusion->addCon($contact);

So this function puts them into the database.  The next thing is asking them questions.

Multiple Businesses And Custom Fields

So we have multiple businesses, lines or entities in our business.  One secret to using Infusionsoft for this purpose is using a Custom Field to manage something like this.  If  you had multiple divisions, this would make sense, or methods people come through your CRM.  So, we also check in our system to make sure that the person is in the right system by checking on the custom field.  All customer fields need to be prefaced for Infusionsoft with an underscore, so if you needed to create a custom field in Infusionsoft called Division, it would be called “_Division”.

Autoresponder

The first time people get on the list for Take It National they are shipped an auto-responder.  We actually house the email that gets sent in Take It National not within Infusionsoft.  This could be done either way.  What we do use is this function:

$sent_status = $Infusion->sendEmail($clist,”$company_name <$events_email>”,”~Contact.FirstName~ <~Contact.Email~>”,””,””,”HTML”,”$fname: $company_name Notification Email Confirmation”,”$email_content”,”$email_content_text”);

If you are a programmer, notice that you can send both HTML and Text through this simple API command send out an email.  We send a copy of our HTML from Take It National’s content system with tagging.

Tag Em And Bag Em

Finally, once we have put the new contact record into the system we tag our records with nice segmented interests.  The call for this starts with checking to see if the record is in the system, through a query of Infusionsoft contact list:

$ContactID = $Infusion->GetContactID($fname,$lname,$email);

And we assign tags to each record using grpAssign:

$result = $app->grpAssign($contactId, $groupId);

There is a lot more to it than just this, but hopefully you get the point that we are tightly integrated with Infusionsoft and using the API and it works well.

Let me know if you have any questions.  They say that you can get all the answers through the Infusionsoft API Forum, but I have had to figure a lot of this out on my own over the past 2 years, so let me know if you have any questions.

Dan