We like Infusionsoft. It’s the CRM we’ve been using ourselves for the last 3 years and have developed a native integration so that customers using our Call Tracking and Hosted Telephony platforms can import call data, call recordings, etc., straight into their own Infusionsoft applications allowing them to do some pretty cool stuff such as triggering campaign sequences, applying tags and creating custom fields.
However, getting started with the integration wasn’t quite so easy so I thought I’d provide a helpful guide on how to get started with the API.
In order to build our integration we first had to work out what was actually possible using the Infusionsoft API. They have a Developers portal which is the place to start. The guys at Infusionsoft teamed up with the guys at Mashery to provide a simple way to test the Infusionsoft API without any coding. This provides a useful starting point for developers to get to grips with Infusionsoft API calls prior to writing their own apps.
If you haven’t heard of Mashery they do lots of stuff with ‘API Management’, part of which is ‘Mashery I/O Docs’, which is what we’ll be using in this blog post. According to their website, I/O Docs “make it fast and easy for developers to start building with your API. Mashery I/O Docs let you achieve that with a clean, powerful interface for executing live API calls right from your API documentation.”
To get started you need to create a Mashery account. Personally, I find this stage a bit odd as normally you’d think if you were creating a Mashery account you’d head over to www.mashery.com. However, the registration process is built into the Infusionsoft Developers portal and that links your Mashery ID with the Infusionsoft API.
There looks like a lot of info you need to enter but most of it is optional:
Mashery will email you an account activation email (so enter a working email address :-)).
Your Mashery account will now be created along with your Mashery Key and Secret.
OK now authorize Mashery to use your Infusionsoft account, we do this directly in Infusionsoft I/O Docs.
Note: If you don’t see the ‘Existing Client Credentials’ drop-down then you’re not signed in to your Mashery account .
From the ‘Existing Client Credentials’ drop-down select the Mashery app you created earlier. The ‘Client ID’ and ‘Client Secret’ fields should be automatically populated with your Mashery Key and Secret. Hit the ‘Authorize’ button and a window will pop-up allowing you to enter your Infusionsoft login credentials.
Once done the pop-up window will close and a new ‘Authorization Code’ field will appear pre-populated. Hit the ‘Get Access Token’ button and a new ‘Access Token’ field appears.
Phew! That’s a lot of ID’s, Secrets, Codes and Tokens! But now we’re at a stage where we can make some API calls 🙂
Let’s try and find one of our Infusionsoft Contacts by their email address. Scroll down to the ‘ContactService’ endpoint and click the POST button to expand the ‘findbyemail’ method. If the ‘apikey’ isn’t already filled in then just copy and paste the ‘Access Token’ we just generated. Enter an email address of a known Contact and ‘Add Field’s of your choosing. Hit the ‘Try it!’ button.
If all’s gone to plan you should see information about the API request and the response.
Now let’s take a look at another example. Scroll down to the ‘DataService’ endpoint and expand the ‘load’ method. This API call allows us to query any table in the Infusionsoft database.
There’s a handy drop-down list of table names but there’s no corresponding drop-down of ‘wantedFields’. So how do you know what field names are available? The list can be found by looking at the Infusionsoft Table Schema Documentation.
Once you’re happy with the API you can start creating your own application using one of the Infusionsoft SDK’s or write your own.