Is it possible for Webflow to use external APIs (like this from Braze)?
What I’m hoping to do is to get/update a user’s subscription status from/to Braze by calling the Braze API and then displaying the result in a Webflow form (e.g., display a checked checkbox if the “subscribed” status returns a 0, or display an unchecked status if Braze returns a 1).
I’m not sure if I need to use an HTML embed, use something else, or if it’s not currently possible in Webflow. A previous post from Sep 2017 seemed to indicate it wasn’t possible, but that was two years ago…?
You could likely do this, but it depends on whether you want to run the whole custom script in the browser or if you want a server-side solution.
You could pretty easily make a GET request (via a JS snippet added to the Page Head code) to the Braze API so long as you provide the parameters required by Braze, and then write an if statement to tick a checkbox if 0 or 1 is returned from the call. The big issue with that method though is that you have to pass your API Key as a parameter in the GET request, which is generally frowned upon for security reasons, as anyone can access that key and with relative ease, make calls to the Braze API on your behalf.
That said… if you wanted to do this client-side, you can use an XMLHttpRequest to make the GET request or use Fetch, which is probably the better of the two. Hope that helps!