Re: Having problems with tokens not being shown in web link

Anonymous
Not applicable

Having problems with tokens not being shown in web link

I have a question regarding the API and tokens:

We're sending emails through the REST api's Request Campaign endpoint. The emails are being sent just fine, and tokens are being placed as one would expect. What fails though, is the option for "Include View as Web Page" under Program > Email > Settings.

The snippet gets included as you would expect, but the tokens are not being shown through this web link.

My question is, since one of our emails are adding tokens: How do I make sure that tokens are respected and used in this view?

Thank you!

5 REPLIES 5
Grégoire_Miche2
Level 10

Re: Having problems with tokens not being shown in web link

Hi Rasmus,

Are you using the token as a href value in the <a> tag :

<a target="_blank" href="{{system.viewAsWebpageLink}}">

-Greg

Grégoire_Miche2
Level 10

Re: Having problems with tokens not being shown in web link

Second thought,

{{system.viewAsWebpageLink}} is a system token, not a program token. You cannot change it's value.

-Greg

Dory_Viscoglio
Level 10

Re: Having problems with tokens not being shown in web link

Hey Greg, the issue Rasmus was having is that he was sending tokens through the request campaign API, but those are discarded after 1 hour. When they were going through the "View as a Webpage" token, the other tokens that the API previously programmed were now showing "empty". The tokens have to be added outside of the request campaign API if you want them to be persistent.

SanfordWhiteman
Level 10 - Community Moderator

Re: Having problems with tokens not being shown in web link

Hey Greg, the issue Rasmus was having is that he was sending tokens through the request campaign API, but those are discarded after 1 hour.

Different type of token in that link.  The REST access token (access_token param or OAuth Bearer header) has a 1 hour lifetime.

Dory_Viscoglio
Level 10

Re: Having problems with tokens not being shown in web link

Hey Rasmus, not sure if you're still dealing with this, but if you're adding the tokens through the request campaign, the issue is that those tokens are discarded after 1 hour. You need to add the tokens as explained in the Developers link below.

http://developers.marketo.com/documentation/asset-api/create-token-by-folder-id

Re: REST API - Invalid token