Outgoing call to external API endpoint with user's data present in the URL

Hey there,

I’ve built a user flow with several steps where a user answers a series of question.

When the user reaches the last step of the flow, I have all the user’s data stored in the URL to be able to send a request to my partner. I’d like to run an outgoing call from my Bubble app and sends a request to an external partner. The call must be done when the user clicks on the CTA of this last step.

My setup:

I installed the API connector plugin and filled the information provided by my partner API documentation.

I set the use as: Action + Data type: JSON

What I need to do is only to call this partner API endpoint and create a new user in their database with a list of information associated to this user. I’m not sure if it’s needed to create a user in Bubble database before running this call or not.

Here’s an example of parameters I’d like to pass in the API call:

  • project_step=hesitating

  • number_adults=2

  • budget=1500

How should I setup my workflow to pass the user data present in the URL as the body of my API call? I can see the API action under the plugin list and I selected it.

Thanks a lot for your help :pray:

You just need to add them as parameters in your API call. You can do that in the API connector.

Of course it depends on the API you’re calling as to how or what those parameters should be.

Hey @adamhholmes , this is what I’ve done to initialize the call during the setup via API connector.

But this information is not static and will be different for each user that complete the flow and send a request to my partner.

Is it possible to use a variable and get the value from page URL for all these parameters?

uncheck private for all fields you want to dynamicly setup

then in the action you will see those fields

in the action, set the data for each field with “get data from page url” as a dynamic datasource and refer to the url parameter

Dont forget : if you use url parameter, it can be touchy if people use accents or specials caracters it can break it (& or = or ?) or accents replaced by unicode

I recommand storing those values in fields at user level (or sattelite) even if the user is not loggued in, current user works and store temp datas

States at page level can be an option but ifthe user refresh the page, all answers are lost.

1 Like

Yeah… you need to uncheck the ‘Private’ box for any parameters you want to be able to pass in dynamically in the workflow.

1 Like

Thanks a lot Sarah. I’m currently implementing it and will let you know if it works well.

Regarding this:

This is a risk I did not identify, well spotted. There’s only 1 step with text input that could lead to the situation you described.

Is storing the value in fields at user level a big effort now that I’ve set everything as URL params? How would you do this without having the user creating an account at 1st step of the flow?

create fields on user datatype, then save it with : make change to thing (where the thi g is current user)
Even if no user is created, temp data are saved

1 Like