Returning Raw Body text

I have a strange problem that is blocking me. Hoping I can get some assistance.

I have defined an API to call a backend workflow with the purpose of returning a fairly complex json object, however when I try and capture ‘raw body text’ the field is blank.

Detail:

B.E Workflow 1 triggered from F.E, calls API defined in API connector (API 1). Parameters set to two unique ID’s only.

API1 receives the two unique IDs correctly and calls B.E workflow 2 which takes those IDs and returns 5 fields, let’s call them Name, Phone, email, postcode and type (that list will expand significantly but I’m trying to prove the concept so far).

In B.E workflow 1 I have a step to capture the raw body text from API1 and pass it off to a pdf generator service via API, it needs to be json in a string to be accepted by the endpoint.

Now comes the issue, if I try and capture the raw body text it returns a blank field (confirmed using webhook).

If I hit B.E workflow 2 using postman I get the correctly formatted full JSON object as expected.

To add further confusion if I log a field instead of raw body text then I get the value. This isn’t any good though as the 5 fields are going to expand to around 80 by the end of the implementation so I really need the raw body text.

Any ideas, suggestions, ridicule and frustrations are welcome! Hopefully I’m missing something and someone wiser than me will come along with an answer!

Thanks in advance

Phil

Can you post screenshots? In API connector, did you activate both detect request header and continue if error checkbox? Without them checked, raw body will be empty

1 Like

Hi. I’ve defined the parameters manually, I did try detect but the headers I got back didn’t contain the fields I needed and as postman returns the correct data when I call the workflow having defined the parameters manually I didn’t see why that route was required

Please share screenshots of your settings.

Hey. Apologies for the delay, i was ill over the weekend.

Here’s the screenshots of the relevant settings:

This is the Backend workflow which is initially called by the front end to kick off the process.

Here’s the API it calls (ignore the key1 ‘private’ checkbox):

Here’s the result of that api being initialised:

and here’s an example of the postman response from hitting the same endpoint:

if i then point that endpoint at web-hook all I get is a null value for the relevant field suggesting that when bubble tries to send ‘raw body text’ it returns no value, despite it being available in initialisation and through postman.

Hope this helps provide some clarity.

Thanks for your help

To add to the above I switched to ‘detect data’ with headers ignored and the backend workflow initialises correctly, calls correctly from postman but when called from within a backend workflow returns a blank ‘raw body text’ value. I know it’s not a sequencing issue as if i set it to return a single field then that value is successfully passed through.

Any ideas welcome, very likely seems like a bubble bug

If your goal is to get the raw body from your API call in API Connector, you need to activate both checkbox for header and errors.

If your goal is to access raw body from request made to your Backend WF, you need to activate Detect data and Detect header to get the raw body

1 Like

finally got it working. I reinitialised with headers included and that enabled the raw body text option

1 Like

thakns Jinci. literally just typed the above reply as your message landed. wow that’s been a fun few days!! really appreciate your help, without you pointing me back down the ‘detect’ route i wouldn’t have carried on pushing at it. thanks again

1 Like