Skip to main content
February 2, 2018
Question

Rest API: Is it possible to get the lists associated with a lead

  • February 2, 2018
  • 2 replies
  • 2356 views

Hi,

Is there any way to get the lists for an Lead.. (ie) If I pass the Lead id, it should return the lists.

Thanks,

Bala

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

2 replies

Jep_Castelein2
Level 10
February 2, 2018

Not possible at this time. Good idea though.

Jep

SanfordWhiteman
Level 10
February 2, 2018

Clumsy-but-working workaround: maintain a JSON array in a Textarea field that echoes their list membership.  Use a webhook to maintain the array. Obvs. requires a set of operational trigger campaigns but will do the trick and can focus on a strategic subset of important lists.

February 4, 2018

Thanks for the replies.

Hi Sanford,

     Could you please elaborate more on your solution. We are actually planning to push the marketo id to a queue to do the post processing in the backend to pull the data.

Thanks,

Bala

SanfordWhiteman
Level 10
February 5, 2018
  • A Textarea field, memberOfLists. This will hold a JSON array (or a JSON object, if you wanted to store more information such as the date added, but for now just think of it as an array of strings, each the name of a list).
  • Two webhook defintions, Maintain memberOfLists - Add and Maintain memberOfLists - Remove.
  • Whenever you add or remove someone from a list, call the corresponding webhook.
  • Use a Program-level {{my.token}} to store the name of the list, so a single webhook definition can be used regardless of where (in Marketing Activities) the webhook is called from.
  • The current {{lead.memberOfLists}} value and the {{my.managedListName}}value fo in the webhook payload. The remote service reads the array and either merges in or removes the value, then responds with the new memberOfLists value.
  • memberOfLists contains all the lead's lists, or at least the interesting ones you decided to manage this way.

P.S. Be aware that changing a list's name after it's created will disrupt the process (which, to be clear, is also true of your originally desired feature, since only the list ID is immutable, not the name).