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

Can pass trigger token with webhook?

  • February 1, 2021
  • 2 replies
  • 4926 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

New Participant
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
New Participant
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.
New Participant
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?

 

 

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
February 1, 2021
Yes.
New Participant
February 3, 2021

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

Any suggestions?

Thank you!

 

SanfordWhiteman
New Participant
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.