Forum Discussion
GET call to backend API in canvas?
Hi! Can't you send the user status as a custom attribute on their Braze profile? That would be the easiest solution. Then, conditional statements take care of the rest.
You can make an API call using the following code:
{% connected_content YOURENDPOINT :save data %}
Replace the endpoint and add this to the email template within the canvas. "data" will be an object that contains the response of the API call. If the response is the status, then you can do operations using "data". Otherwise, if the response is a user object, you can say "data.status" to get the variable you need from the object, and so on.
Using conditional statements, you can define what the user sees based on the value of the variable from the API response.
Let me know if this helps.
- PeytonFNM2 months agoCollaborator
Hey Ashleedolan! Agreeing with Arso on this one that making a connected content call would be the best option.
For the Canvas setup, you could start with a 2-hour delay after entry. Then, add a user update step that pulls a value from a connected content call. If that value exists, you’d write it to the user’s profile as a custom attribute. From there, you can add a decision split step or audience path step looking for does the custom attribute = X? If yes, they go down Path 1; if no, they follow Path 2.- Ashleedolan2 months agoCollaborator
Thank you. There will actually be a few separate values that we are checking for - could I replace the decision split here with an audience path based on those custom attributes? For example:
- PeytonFNM2 months agoCollaborator
AshleedolanYes, absolutely! This will work!
Related Content
- 12 months ago
- 2 years ago