I am trying to figure out how to utilize the Bubble API
I’ve successfully set up a Get Call. What I am doing is using two Bubble Applications of mine to try and get them to use the API.
Application 1 has the data and is set up to Enable the Data API. Application 2 has the API Connector Plugin with the calls set up.
What I am struggling with now is trying to set up a Post. I want to take data created in Application 2 and send it to Application 1 where it will create a new entry in Application 1 database.
In Application 2 I have set up a Post call and have initialized it successfully. My Application 1 has the create via API checked off.
What I don’t understand is how to SEND the data from Application 2 to Application 1…my initial thought is that there would be a workflow action that I could trigger with the press of a button once the data has been entered into the input elements on Application 2, however, I see nothing that would allow me to send the data.
How am I suppose to send the data from Application 2 to Application 1?
Do I need to set up some workflow in Application 1 to accept the data?
The reference does a minimal job of explaining the process and it is completely void of any indication on how to send the data by way of initializing the request.
The reference has some more useful information, but it is down a little further, under Data API (hopefully the link takes you to the correct spot on the page).
Maybe the Bubble App Connector is more useful than the API Connector in this case?
Otherwise, I mostly build APIs that have some sort of workflow behind it. That means that I build a workflow in the Backend Workflows page which I always found easier to troubleshoot.
Speaking of troubleshooting, try using Postman or Hoppscotch (née Postwoman) might provide you more useful errors than Bubble.
As per usual my limited capacity for ‘give up’ pushed me to dig deeper into the forum with more and more refined searches…finally came up with a search phrase ‘trigger api post’ (sometimes finding the right phrase might be the most difficult part) and came across this post
I had previously set everything up correct for the Post call as the Initialize Call was creating data in the other apps DB…the only difference of not finding a workflow action that could be triggered to trigger the POST call was the “Use as” portion at the top next to the name…that needs to be set to Action to get a workflow action associated with the call rather than Data.
Also, need to uncheck Private next to the key values to enable dynamic values to be sent.
Do you NEED to have a REST API (the Data API) here?
If this is just for “internal” use then it will be simpler to use either the App Connector or a Backend workflow (this is the “trigger workflow” option that you mention).
If this is to distribute to third parties, who will interact with your App via API…
Your API connector in 1 will “just” do a POST to …
At this stage I am really just trying to explore more of the feature. I have a few potential use cases for it, but nothing that I am implementing at the moment. Having a better understanding of its functionality will definitely help in preparing some future projects that would make use of it.
I will have to explore the App Connector a bit more.
In regards to the Backend Workflow…is there a way to set up a backend workflow in Application 1 and have Application 2 trigger without the use of the App Connector or Api Connector?
I believe the Authorization Bearer is this? I have below in App 1 setup the API Token
And then in App 2 use this token in the header of my calls
Is this the Authorization Bearer? I’ve seen other threads reference the authorization bearer and in my limited use of API calls to 3rd party services such as stripe have seen the need to add ‘bearer’ into the headers and other times not needed to.
So with what I have shown in the screen shot, not 100% confident that this is the authorization bearer, or if it is, that I have set it up properly.
Also, in the event that I were to distribute to third parties who will interact with my App via API is there a way to dynamically create a new Authorization Bearer, or would it necessitate the creation via the applications ‘Settings - API’ tab in the editor?
I’ve seen this Postman referenced previously and just checked out the site.
Are the majority of reasons to set it up in Postman first to avoid any ‘mishaps’ from affecting the application whose database would be modified via the API, or does Postman provide for some helpful clues on how to troubleshoot when setting up APIs that a non-technical person like myself would benefit from the service?
If I were to be providing an Authorization Bearer to third parties for access, is there a need to create a limiting access privacy policy or would having the ‘Everyone Else’ policy enable the create/delete/modify via API be okay since the Authorization Bearer acts as ‘access token’?
Do you generally have any tips or insights into some best practices regarding setting up the conditionals for a privacy policy?
I’m kind of thinking that to setup a privacy policy to limit access I would need to have the user be signed up to my app that provides the API to make use of the conditional statement since it is limited to ‘current user’ and ‘this datatype’.