How To Return A 400 If Required API Endpoint Param is an Empty String?

I think that the app is sending a string or something and Bubble picks it up as something there so it considers it a code 200, but really the paramater is empty or null and it shouldn’t provide a code 200 as one of the required (non optional) paramaters is missing.

How do i prevent this so that the workflow doesn’t run and a 400 is generated?

My approach would be to create a first action (Terminate) checking all fields for empty value.

Yeah I thought of that and it will work but what I’m after is the 400 response instead of a 200 with empty fields

This is why the option is there to be sure the API will not stopped for nothing:

13%20AM

Yes i know that’s there but i’m looking for a 400, not a 200, if one of the required fields is empty.

How to change a return value (200 to 400) in js (if it’s possible) ?
Probably an option Bubble can add?

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.