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

Anonymous
Not applicable

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

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

Tags (2)
5 REPLIES 5
Jep_Castelein2
Level 10

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

Not possible at this time. Good idea though.

Jep

SanfordWhiteman
Level 10 - Community Moderator

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

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.

Anonymous
Not applicable

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

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 - Community Moderator

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

  • 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).

Anonymous
Not applicable

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

I got you, thanks Sanford.

- Bala