How to redirect to a custom URL in an API workflow

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?

yes, it is.

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

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!

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.