Tuesday’s Tip: Achieve an Infusionsoft campaign goal with an API call

One of the lesser known goals available in Infusionsoft is an API call. By making a specific API call you can achieve this goal to move a contact through a campaign.

The goal has two parameters: Integration and Call Name. These can be anything you want but if you have multiple goals with the same integration and call name, then they will all be achieved by the same API call.

api-call

To achieve the goal, you make a FunnelService.achieveGoal API call with the integration and call name you configured in the goal, and the contact ID you’d like to achieve the goal for.

If you are using the free Novak Solutions Infusionsoft PHP SDK, then you could do something like this:

<?php

// Include the SDK
require_once('Infusionsoft/infusionsoft.php');

// Set the contact ID
$contactID = 123;

// Call the achieveGoal method
Infusionsoft_FunnelService::achieveGoal('someIntegration', 'myAPIcall', $contactID);

I hope this helps you in building your own integrations!

8 Comments

    • Our SDK focuses on reliability and ease of use, and does quite a few things differently.

      A few examples of what we do differently:

      Our SDK handles Infusionsoft API failures better. For example, if you try to update a record and the Infusionsoft API returns an error (which is disturbingly common) then our SDK will try again.

      It also uses an updated XML-RPC library that prevents errors when Infusionsoft sends bad data (again, a common occurrence for many IS users).

      We use our SDK exclusively for all of our products and client work.

      Reply
      • Very cool! If I switch from the Infusionsoft SDK to yours, is there anything I should know? (ie.. would I have to make any changes to the function calls?)

      • It isn’t a drop-in replacement. It’d take some work to switch an existing project over to our SDK, but we feel it is easier to get started with for new projects.

  1. Hi Just want to ask, $contactID is this required? bec. what I have right now is an addCon that automatically have a contact ID inside infusionsoft and also I want this to be added on the campaign,

    Reply
    • The example shown is if you are using the Novak Solutions SDK for Infusionsoft. addCon is part of the Infusionsoft PHP iSDK. I don’t recommend mixing the two SDKs, and we do not provide support for the iSDK.

      Reply
  2. Hi Jacob,

    How can i use this achive goal technique when i am adding a new contact?

    Here is your code:

    Infusionsoft_FunnelService::achieveGoal(‘someIntegration’, ‘myAPIcall’, $contactID);

    I am trying to add a new contact to a campaign and i dont have a contact ID for the new contact.

    Can you suggest me a way to do this?

    Thanks,
    kad

    Reply
  3. How do I pull orders with your SDK? I have a 3PL that ships for me. I want to be able to pull new orders with all the details, etc.

    Reply

Leave a Reply