I am not well versed with webhooks, asking on behalf of a dev, can you pass trigger tokens like {{trigger.subject}} with webhooks?
Thank you!
Solved! Go to Solution.
We tried like in the screenshot below, got an error -
Any suggestions?
Thank you!
Thanks for your reply. How it should be - can you guide us?
Fundamentally, you can't do this attempt at concatenation within a JSON payload.
The Marketo {{trigger.token}} could be used on its own as a JSON String property:
{
"someProp" : {{trigger.token}}
}
And the {{lead.id}} can be used inside a JSON String only because it is itself a Number (so will be printed exactly as-is):
{
"someProp" : "Some text and then the {{lead.id}}"
}
If you need to pass a value that consists of static text plus the {{lead.id}} and {{trigger.token}}, you could set a new custom lead field to that final value using Change Data Value, then do:
{
"someProp" : {{lead.New Field that was set using Change Data Value}}
}
(I wouldn't do this myself — I'd use a custom service that relays to the original webhook — but should work for you.)
Thanks for the detailed answer. Appreciate it! I'll pass it along
Another workaround I have found useful is to use the {{campaign.description}} token in webhooks so that the same webhook can be used for different smart campaigns but have different payloads or be sent to different endpoints by editing the description of the campaign sending the webhook
What if you have multiple campaigns within a single program then a {{my.token}} won't work if you want to use a single webhook?