cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic API Triggered Canvas

db-origin
Practitioner

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

7 REPLIES 7

AllanHeo
Strategist II

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?

AllanHeo_0-1691021296043.png

AllanHeo_1-1691021309382.png

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. 

https://www.blog.fornowmarketing.com/blog/braze-step-by-step-guide-split-users-based-on-canvas-entry...

Lmk if you have any questions! 

Allan

db-origin
Practitioner

Thanks @AllanHeo - this looks like some great info. Let me have a tinker and see what I come up with 👍

db-origin
Practitioner

Screenshot 2023-08-03 at 2.23.39 pm.png

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 %}

 

 

AllanHeo
Strategist II

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?