API Goal - where to start

Hi,

This is a real newbie question. I am using the Infusionsoft API to do various tasks just fine, however I am stuck on where to begin with API Goals.

So I have an API goal setup in a campaign called ‘test’. How do I get that goal to trigger? I have looked through the API manual and cannot figure out how to trigger it.

I am using PHP and CURL to send all my REST API requests. I can see details to Achieve a Goal in the XML docs, but not REST docs. Can someone point me in the right place?

Many thanks,
Mark

Hi @Mark_Williams, in order to trigger an API goal, you’ll first need to go into Campaign Builder and find your Integration and Call Name.

image

Here’s what an example XML-RPC call would look like.

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>FunnelService.achieveGoal</methodName>
  <params>
    <param>
      <value><string>YourPrivateKey</string></value>
    </param>
    <param>
      <value><string>YourIntegrationName</string></value>
    </param>
    <param>
      <value><string>YourCallName</string></value>
    </param>
    <param>
      <value><int>contactId</int></value>
    </param>
  </params>
</methodCall>

Here’s a link to the full docs on the achieve a goal call.

In the case of api goals, the api call “is the trigger”. ie you setup the goal in campaign builder and then trigger it with the api.

Thanks @Nicholas_Trecina, I was hoping not to use XML-RPC, but use the REST API instead. Is that not possible?

I have already setup my Call name in the Campaign, but want to know how to trigger it using the REST API.

Thanks @John_Borelli,

I understand that the API call is the trigger. I just don’t know how to make the call using the REST API.

There currently isn’t a way to trigger the API goal using the REST API but it is on our backlog.