Gzip enconding on API response

I have a plug-in with API calls. These are action calls which are invoked within the workflow of a button on an app. It was all working fine a couple of weeks ago, but since Friday something has broken. The problem seems to be in the parsing of the response from the API call. I get a message back in a dialog box when I run the app saying: Workflow error - Error parsing data from : followed by some text which is not readable.

I have refreshed the response type expected by the API call, by pasting manually the JSON from a call in Postman into the API definition in Bubble.

How can I go debugging why the response is not able to be parsed by Bubble?

Try using Google’s Postman tool, it helps to see what is coming back. The headers should give a clue as to the format of the content.

@mishav it turns out that the response from the API is now gzip compressed. I didn’t realise this initially because Postman appeared to work in exactly the same way as before (that was the first thing I tried to see if the API had changes). It turns out that Postman was somehow transparently unzipping the compressed response.

This is related to another thread from a couple of year back:

Hi @nick.corrie,

Try adding this header to the request,
Accept-Encoding = identity

1 Like

@mishav - thanks, that helped to eliminate the error. However I still can’t access the response - everything is blank.

FYI, previously the Accept-Encoding on the request header was set to gzip, deflate.

This is the response after changing Accept-Encoding = identity

image

@mishav I have resolved this issue… by going back to the API definition and running the Modify Call Types on the API call. Interesting to note that previously I had pasted in a sample JSON response captured in Postman, yet when I run Modify Call Types it populates a different set of key names, which are prefixed with body or header.

2 Likes

this helped my api call thank you!