08-01-2023 10:08 PM
I want to trigger a Canvas using an API but also have that Canvas fire a Webhook message at the end of processing.
I would like to pass in some information in the API trigger payload that would dynamically switch the Canvas between two webhook messages. Since I cant use an api_triggered_property in a webhook message URL, I need another way to dynamically set a callback URL for the inbound API call.
Is there any way to use an api_triggered_property in an API Triggered Canvas to make a decision within that Canvas?
Any workarounds that anyone can share?
Thanks
Darren
08-02-2023 05:10 PM
Hey Darren,
Looks like you can use API Trigger Properties in the Webhook URL field. And interestingly, since the URL field is a long text input, you can do all sorts of things using Liquid (fun!). How does the second screenshot look as a potential solution?
If reporting is important and you need to use two separate message steps, then you should be able to apply the exact same process/logic that I wrote in this blog below. We use the User Update step to log the necessary data as a custom attribute, which you can then use to set up the Audience Path to differentiate the Webhook URLs.
Lmk if you have any questions!
Allan
08-02-2023 05:47 PM
Thanks @AllanHeo - this looks like some great info. Let me have a tinker and see what I come up with 👍
08-02-2023 09:26 PM
Unfortunately I get this error when I try using the above in Webhook URL
Warning: Error saving your Canvas due to error on step Send Webhook: Invalid URL {% if {{canvas_entry_properties.${active_instance}}} == "proda" %} https://webhook.site/12135b8b-c085-4019-979c-x {% elsif {{canvas_entry_properties.${active_instance}}} == "prodb" %} https://webhook.site/12135b8b-c085-4019-979c-x {% endif %}
08-07-2023 03:15 PM
Hey Darren,
I'm just seeing your response! I just re-tested it from my own dashboard and got it to work successfully. We may have to look into other areas that might be causing this issue. Please feel free to schedule a call!
https://calendly.com/d/364-k6g-kxv/30-minute-meeting
Btw... Is this Darren T.? Or a different Darren?