Skip to main content
June 3, 2014
Question

Custom Token per Lead Via Request Campaign API

  • June 3, 2014
  • 10 replies
  • 2309 views
Hi,

I am trying to send out emails with personlized tokens and values per lead via request campaign API. But how do one associate each lead with its respective token/values? I was able to send emails to multiple leads with tokens having single value. Its not per lead, but i was able to acheive the same using schedule campaign with importToList API. If I do this then i will loose the capability to query the campaigns via api and also many manual steps involved in achieving this. Could you please suggest how it can be done via request campaign api? or any other best ways to achieve the same.
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

10 replies

June 3, 2014
June 3, 2014
Hi,

I have gone through the documentation but did the tokens mentioned in the example will be applied to all the leads. It is not a per lead token where I can associate a particular
{{my.conversationtopic}} for lead1 as Hello World
{{my.conversationtopic}} for lead2 as Welcome to Marketo

for the list of Leads in a single RequestCampaign API call.

Can i do the above? Am i missing something?

June 3, 2014
Hey Steve,

If you want to use requestCampaign API for the usercase you describe, then you'll have to issue a separate request for each lead that you want to email.

An alternative would be to use importToList, which allows you to specify a unique token value for each lead that you list in the request.  Assuming the leads you want to email are already in MLM, you would perform importToList with importListMode=LISTONLY, then list your leads' email address along with the values for any associated tokens in importFileHeader.  Set campaignName equal to the batch campaign that will be delivering the email and then perform scheduleCampaign to kick off this batch campaign.
November 10, 2014
Any plans on adding this functionality to the requestCampaign endpoint? It's a very common use case to create custom links/content on a per lead basis. Creating new lists each time just for this functionality seems like overkill.

 
November 10, 2014
@Brad, you can add an attribute to each lead, then reference it as a token in your email template. After you create a custom field, you can then include it as token like {{lead.CustomField}}.
November 13, 2014
This is a workable solution thank you!

Would it be possible to send in JSON data that could then be parsed by the velocity email script when rendering the email? That would be a clean solution, otherwise we'll have to create a bunch of string fields and a more complicated email script to put it all back together.

Thanks
 
November 13, 2014
You can store JSON data on the lead record using the API. You could store JSON data as a program token using the UI. 
November 20, 2014
Fantastic! That was the last major technical hurdle...thanks for the prompt reply.
November 21, 2014
[Ignore this reply. Wrong account].
November 21, 2014
Happy to help! Let me know if you have any other questions.