Fixed text api Call Response

Hello all! This API response is kind of “fixed” when initialized :confused:

I wanted to parse the “error body” but seem as there’s no error bubble return nothing so I’m stuck there.

Any idea to deal with this ? The only solution I see is pass through another tool like pipedream but I don’t like to use extra layers …

Thank you

Could you reinitialize manually with the correct structure for error?

You can manually edit the response with all the possible fields. Is that what you are looking to do?

@boston85719 curious to know how I can manually reinitiliaze

@J805 get the response to be parsed with data strcture different from init

What I did is received the response as text / parse it with regex and it is working fine !

Thank you

This looks less like a parsing problem and more like a response-shape problem.

The split I would prove first is:

  1. the API returns HTTP 200 with an error object in the body;
  2. the API returns a non-2xx status and Bubble treats the call as failed before exposing the body as a normal response.

If it is case 2, the body can look visible in the initializer but still not be available where you are trying to parse it, because the success schema and the error path are not the same thing.

Before adding Pipedream, I would test one deliberately fake request that forces the same error, then check whether Bubble exposes any raw error body in the workflow step output. If it does not, the real workaround is not a different parser; it is changing where the error is caught.

Is the provider returning the error payload with a non-2xx status code, or is it a 200 response that contains an error field?

I’d try first copying the existing initialized json into something like json lint, then initialize to get an error response and combine it with existing, then do manual initialization…initialization as far as I understand just grabs the shape and data types of response, so if you want all values available, a manual initialization with those values provided would enable you to initialize with fields for success and errors already known.