Use REST API to identify if a Lead belongs to a Smart Campaign or Marketo Program | Community
Skip to main content
September 28, 2017
Question

Use REST API to identify if a Lead belongs to a Smart Campaign or Marketo Program

  • September 28, 2017
  • 2 replies
  • 3215 views

Hello,

Is it possible to use the Marketo REST API to provide a Lead ID, Marketo Program ID, then result with a true/false response?

Thank you!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

SanfordWhiteman
Level 10
September 28, 2017

Not Smart Campaigns, since those aren't exposed (yet).

If you're looking for an isMemberOfProgram API like the isMember (of List) call I also think you're out of luck. You have to do it in reverse. The exception I can think of is when you only have one relevant status in a program: then you could call status and re-set the status and it'll tell you if the lead is in the program or not. Or maybe I'm not thinking of another way to rotate this... what's the use case, anyway?

September 28, 2017

It is a simple one: present the Marketo form only for those who haven't submitted that specific form (that form being unique in a Marketo Program). And, if the Lead is already in the Marketo Program, present the content instead of the form.

That Marketo Program is a Nurture program or more like a subscription, so I want to make sure they are Subscribed instead of just presenting the content to any known lead in the database.

SanfordWhiteman
Level 10
September 28, 2017

Even if you had an API call that's possible here, it would be a gaping DoS vulnerability to look someone up via REST just because they visited the page.

Instead, maintain a history field containing the program ID ({{Program.Id}}) when someone submits the form in that program.  Check if that field already contains the current program ID, if so just take them to the content, if not gate them.

Ryan_Hagg
Level 2
October 2, 2017

I agree with Sanford that you don't want to DoS yourself however if you have another use case that could benefit from a GetProgramsByLeadID endpoint I did add the idea to the Ideas forum here: and you could upvote it if you see fit.