Re: Trigger for a Program using API

adele_briggs
Level 3

Trigger for a Program using API

I have recently set up a new API to capture some leads from an agency. They are pushing them to Marketo, but the trigger that I've used in the past which is 'fills out form' is not capturing the leads.  What is the best way to capture these in the correct program, do I need to collect a unique field which listens for the field to be updated? If this is the case, what would happen if the lead came through again? If this field already contains data what will the trigger need to be? Any suggestions gratefully received. 

5 REPLIES 5
Josh
Level 4 - Champion

Re: Trigger for a Program using API

Hi Adele, 
The Submit Form REST endpoint should work best for this.  It has a parameter for Form ID and Program ID.  When those are passed it behaves just as a native marketo form inside the program would.  This endpoint is a little finicky, in that it requires that the form ID is sent, that form must exist in your Marketo instance and the fields you send need to be on that form.  If not you will get an error.  

For triggering if the form is submitted correctly, it's just like a native form.  You can create a smart campaign trigger of "Fills out Form" and add any standard constraints you want from there.  I hope that helps but I'm happy to dig in more!

Helping companies increase revenue by leveraging technology and data.
adele_briggs
Level 3

Re: Trigger for a Program using API

thank you for this.

 

I have two instances, they are both using the Rest api.

 

The test lead came through on one, but then I discovered that 300 leads were missing. They said that nothing had changed their end, but I guess it could be that there were missing fields on the forms. I will check that. thank you very much.

SanfordWhiteman
Level 10 - Community Moderator

Re: Trigger for a Program using API

Like Josh says, the Submit Form API endpoint is easy to trigger on since the results look just like a standard Filled Out Form.

 

They can also use the Push Lead API endpoint, which has the corresponding trigger Lead is Pushed.

 

However, you left out an important detail: which API endpoint they’re currently using. If they’re currently using the primitive Sync Lead API and refuse to change — poor customer service of course, but it may happen — then you’re in a bind. In this case, as you predicted, they should update a new DateTime field Last ExampleVendor Update DT with the current timestamp. Then you can listen to changes to that field.

adele_briggs
Level 3

Re: Trigger for a Program using API

thank you for this additional information. the endpoint was the Rest api. I am wondering now if they did not have the form ID included.  It is a bit of a hodgepodge atm, and my thoughts were it did not have to be this difficult. usually when I set up an API the instructions are very explicit. Thanks again, very useful.

SanfordWhiteman
Level 10 - Community Moderator

Re: Trigger for a Program using API


@adele_briggs wrote:

thank you for this additional information. the endpoint was the Rest api. I am wondering now if they did not have the form ID included.  It is a bit of a hodgepodge atm, and my thoughts were it did not have to be this difficult. usually when I set up an API the instructions are very explicit. Thanks again, very useful.


OK, but to be clear, “the REST API” is far too general. It doesn’t tell us anything about the required payload and what you’d expect to see in the Activity Log.

 

I guess you’re saying they were using the Submit Form REST API endpoint, not another endpoint? But then how could they not be including the Form ID, as it’s a required field? Do they really have no information about this at all? That sounds like a dangerous vendor to bring into your environment IMO.