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)
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)
Solved! Go to Solution.
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.)
Sanford Whiteman any help with above would be appreciated.
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.
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.
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?
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!
Great, if you could mark one my answers as Correct when y'get a chance....