How to redirect to a custom URL in an API workflow – APIs


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.

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…:sob:

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!

Is this a backend workflow?

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



Source link

Leave a Comment