SOLVED

Using Marketo Tokens in Webhook Header

Go to solution
Burhan_R
Level 1

Using Marketo Tokens in Webhook Header

Hi,

Im trying to use a marketo token as a value for one of my parameters in my header. For example; I have a webhook that calls and endpoint and returns and auth token as response which I map to lead field (because Marketo only allows me to map response to fields and not program tokens). I then use another webhook to make a POST request to another API endpoint and pass that field with the auth token as header. But when I run my campaign the second webhook fails and returns unauthorised because the value of the token is not being populated. Is there a way to see the output of the headers? I cant see that in the campaign results.

Here is an example fo my token. (assuming the auth token is the lead middle name field)

pastedImage_0.png

Is this the correct way to pass marketo token to headers in marketo? Why is it not populating with the value? (FYI - I tried directly entering a value instead of using tokens and the webhook fired successfully)

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Using Marketo Tokens in Webhook Header

No -- I'm using a {{lead.token}} in a Custom Headers right now, in another tab. Is your trigger campaign catching the change? What is being sent in the header? (Send it to a test server to check.)

View solution in original post

7 REPLIES 7
Burhan_R
Level 1

Re: Using Marketo Tokens in Webhook Header

Sanford Whiteman​ any help with above would be appreciated.

SanfordWhiteman
Level 10 - Community Moderator

Re: Using Marketo Tokens in Webhook Header

You'd have to wait for {{lead.Middle Name}} to be populated (trigger another campaign on Data Value Changes). Can't call the webhooks in the same Flow.

I must say I wouldn't do what you're doing; if an API isn't directly webhook-compatible (I'm writing a very, very lengthy blog post on that very notion right now) then use a webhook gateway that is capable of that kind of OAuth coordination.

Burhan_R
Level 1

Re: Using Marketo Tokens in Webhook Header

Thank you Sanford Whiteman​. Much appreciated. I was trying it by adding a wait step between the 2 webhook calls, I guess that doesn't work .

Yes I completely agree. Ideally I would use some gateway. Its just I am restricted by the requirements from the client and don't have other resources I can use. We get a lot of requests from clients for making API calls via the Marketo webhook so looking forward to reading your blog on this. I am very interested.

thanks again.

Burhan_R
Level 1

Re: Using Marketo Tokens in Webhook Header

I just tried using another campaign and to trigger on data value changes and the webhook still didn't work. Do you know if there is an issue with how Marketo populates token values?

SanfordWhiteman
Level 10 - Community Moderator

Re: Using Marketo Tokens in Webhook Header

No -- I'm using a {{lead.token}} in a Custom Headers right now, in another tab. Is your trigger campaign catching the change? What is being sent in the header? (Send it to a test server to check.)

Burhan_R
Level 1

Re: Using Marketo Tokens in Webhook Header

Thanks. I figured out my issue. It was because the field type was String and not Text area so the response mapping value was being cut off. It works now. Appreciate the help!

SanfordWhiteman
Level 10 - Community Moderator

Re: Using Marketo Tokens in Webhook Header

Great, if you could mark one my answers as Correct when y'get a chance....