Why can't bubble return a custom HTTP status code in API workflows, only 200 (success)?

I’ve been using bubble.io for years, and so far, it’s still not possible to edit the headers of the APIs we create. I wish Bubble would focus more on supporting the API builders on the platform or something similar. I understand that this feature might not be easy to implement (which could explain the long delay), but it’s essential for API construction. For instance, if I want to return an error message today, I can indicate “error” in the request body, but it always ends up with a “200 (success)” status code behind it, even if an error is returned, which can be misleading, confusing, and frustrating for the users who will use and pay for the API.

In fact, it could be a quite simple feature, something like this (which I did using the inspect element):

@emmanuel

image

2 Likes

This is what we get, when the api request doesn’t match the conditional expression on the API, not a perfect solution though.

400 (Bad Request)

Yes, it leaves a lot of vague information for the end user to understand. Eagerly awaiting a native bubble alternative, for now I’m trying to do something in this style (not highly recommended) in my APIs (even though it still returns a 200 success code in the solution):

image


While an original HTTP 400 would return an original error:

1 Like

I see jokes like that on r/programminghumor where they roast people who return a 200 but have a 400 in the response, you should put a comment like "Sorry it’s a limitation of the platform I’m on :pray: " :joy:

3 Likes

:rofl::rofl: definitely :rocket:

2 Likes

Hey! Has anyone found a solution or workaround for this ?
Thanks