I want to create a workflow in the API workflow of Bubble where, upon receiving a GET request, it retrieves the URL of an image from the database and then redirects to that URL.
However, in the GET method of the API workflow, the Response type options are ‘JSON Object’ and ‘Page Redirect (302)’ .
For the ‘Page Redirect (302)’ option, there are only choices for pages, and it seems I cannot achieve the above-mentioned functionality.
Is there any other way to accomplish this?
If not, I am considering implementing an API outside of Bubble just for the purpose of redirection.
I would appreciate your advice.
mike1
November 17, 2023, 9:22am
2
You simply select the “Open an external website” option, not “Go to page” option.
Then on the box, simply choose the API call and URL parameter in that call
Something like this, but it will be the API call not the attached type
I couldn’t find an action like “Open an external website” in the API workflow…
I want to respond to requests to my bubble’s API workflow from external sources by redirecting them to a specific image URL within bubble.
But thank you for your advice!
mike1
November 17, 2023, 10:24am
4
Is this a backend workflow?
mike1
November 17, 2023, 11:47am
6
As this is on the server side, you can’t navigate from it. As its server side there is nowhere to navigate from.
You can add the navigation from the front end after you have called the backend workflow.
Return data from API → Structured JSON → make a parameter called URL
Call your backend workflow through the API connector and it will return the relevant URL
Open external website using that URL
Hi, I want to get the result of a back end workflow without using data base.
I was using state before in my app because everything is done on front end, but I read is not possible to use state on backend worflows.
Ive read somewhere that I can use backend worflow and plugit on the api connector so I can get the results.
However, i cant figure out how to setup backend workflow on api connector plugin.
Any advice please?
Since it’s an API call, redirecting on the page using page navigation after the backend workflow API returns a redirect response doesn’t work well…
However, thank you for your advice!
mike1
November 20, 2023, 1:14pm
9
You can call the backend response from your API Connector. This will be a workaround
Thank you, @mike1 and @georgecollier .
In the end, I created a separate API for redirection and managed to implement it.