[Upgrade to Bubble Version 28] Specify JSON content type when relevant in API Connector calls and rounding fix for the formatted as operator

Hi everyone,

We’ll soon be releasing a new Bubble Version with two changes.

The first will address a bug in the API Connector where if you had a call with the body type JSON, we did not explicitly send that the content-type in the header is JSON (content-type: application/json) which could cause issues for APIs that required this parameter. We now pass in this content-type when making an API call if applicable. If you have manually set a content-type in your header parameters, it will not get overwritten and we will send the one you specified.

The second addresses a rounding bug. When using the “formatted as” operator to round a number, users will have the number be rounded like the “rounded to” operator. This will fix a bug when rounding a number to 3 decimals using the “formatted as” operator.

You can upgrade to the latest version in the Settings->Version tab.

14 Likes

Hi everyone - this change is live!

4 Likes

This is still not working even after upgrading?

What’s not working specifically? If you upgrade the version, you need to deploy to live as well to see the changes on live.

Not working in Dev after Upgrading to version 28. Still getting error from Stripe saying

Raw response for the API
Status code 400
{
“error”: {
“message”: “Invalid request (check that your POST content type is application/x-www-form-urlencoded). If you have any questions, we can help at Stripe: Help & Support”,
“type”: “invalid_request_error”
}
}

The same call works fine via Curl from Terminal or from Postman

2 Likes

Okay that’s a you problem and isn’t related to this update. Set your Content-Type to application/json, and set your parameters like this and it’ll be good:

2 Likes

Correct me if I’m wrong, but from what I read I believe the update was supposed to detect the JSON body and set the Content-Type to application/json for you, which I assume was to make it easier for beginners. It’s in the first paragraph and the first part of this update.

1 Like

Yes this is set in the header but it still doesn’t work

I suspect they have broken something here - you don’t do a version release just for this unless something has gone wrong!

Hey @boston85719 ,

I mirrored all my API calls to Stripe to how you set them up in your course. Did you do this upgrade yet and have you had to make any changes in API connector? This is how most of the calls look - I haven’t upgraded yet I’m nervous something will break. I’m not sure if something will change in the content-type key

It won’t, the post is clear…

Hey all - Thanks for the feedback. We investigated into this issue a bit more, and we found that Bubble Version 28 currently does overwrite custom content-types in shared headers with multiple API calls. At the moment, we recommend that you wait until we re-release the Bubble version to upgrade. If you have already upgraded Bubble versions, you can downgrade to avoid this issue.

4 Likes

Well I stand corrected!

2 Likes

The fix is out now! You should be able to upgrade to the new Bubble Version. Thanks for your patience!

1 Like

Upgrade to version 28 broke all my MS Graph calls from API connector. I had to add a content-type = application/x-www-form-urlencoded header to the token call. The body has always been in this format but I guess the change to version 28 has added an application/json header behind the scenes which is what stuffed it up. Is there any way to see debug information for these OAuth2 token requests?

1 Like

Change the API call URL to somewhere like https://webhook.site which will let you see the API call content and headers that was sent to it

Ah yes that’s helpful thanks

Just to note that version 28 is still breaking Stripe api calls. It appears to still overwrite the content-type.

Oh boy. I’m going to continue to hold off on this update. Have had enough of a headache with updates causing problems lately.

1 Like

@grace.hong Has this been patched yet?

3 Likes