Can pass trigger token with webhook? | Community
Skip to main content
Level 3
February 1, 2021
Solved

Can pass trigger token with webhook?

  • February 1, 2021
  • 2 replies
  • 4949 views

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman
Yes.

2 replies

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
February 1, 2021
Yes.
Level 3
February 3, 2021

We tried like in the screenshot below, got an error - 

Any suggestions?

Thank you!

 

SanfordWhiteman
Level 10
February 3, 2021
Well, you can't create correct JSON like that. The string field (the {[trigger.token}}) is going to be JSON-encoded, then you have it inside another JSON string = broken JSON.
TyronPr
Adobe Champion
Adobe Champion
February 2, 2021

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

SanfordWhiteman
Level 10
February 2, 2021
I mean yeah... but a {{my.token}} for that would be less disruptive, allowing the Description to be used for its original purpose.
TyronPr
Adobe Champion
Adobe Champion
February 3, 2021

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?