POST API using Google App Script doesn't work in Bubble

I have created a POST API using Google App script but it doesn’t seem to work with API Connector and gives a 405 error or “Raw error for the API. Argument error, options.body.”

The same API works just fine in Postman.

Also, the GET API built in Google App script seems to work fine with API Connector.

I have added ContentType: application/json and other stuff I came across on Bubble forum but the problem still persists.

Check in postman settings if ssl verification is toggled on or off. Try to run the API with SSL toggled-on in postman. Bubble API connector by default verifies the SSL certificate

Hi. Thanks for your prompt response. I toggled SSL Certification ON and OFF in Postman and it is working fine. Also, if this were the problem then even GET API wouldn’t run. Right? My GET API works fine in Bubble.

Can you share the payload of the post request please?

[
{
“unique id”: “1716407317066x472813120847085600”
},
{
“unique id”: “1716408387014x965182537259548700”
},
{
“unique id”: “1716408542354x501663222227009540”
},
{
“unique id”: “1716408899134x540888111428141060”
},
{
“unique id”: “1716450043406x554200588134907900”
},
{
“unique id”: “1716482031188x122471276804833280”
},
{
“unique id”: “1716482400893x111278736393895940”
}
]

I’ve been try for years making working on Bubble. The only solution I found is to use GET and parse parameter. But don’t use it if you have sensitives data because url is readable.

Sounds like 2 years Post doesn’t work anymore from Bubble.io (Api connector or even custom code) to AppScript for an unknow reason.

If you find a solution please share :wink:

Hey. There is some issue with redirection that Postman handles but API Connector doesn’t. Probably for POST API created in Google App Script to work in API Connector, we need to change the Google App Script code so that it can handle this error. Since I am not a coder I can’t at this point tell exactly what to do.

Possible to share your settings in API connector?
Did you set content-type header?

Did you tried to compare the request you set in Postmand VS Bubble using requestbin.com (or similar tool) ?

Hope this helps you

Did a few check and search and the problem is:

Requests to Google Apps Script always happen in two stages: The first request draws a redirection response to a generated URL, and the second request to that URL draws the response that you programmed. Google Chrome makes the second request as a GET request (without repeating the POST payload, which the server already knows under the generated URL) and this works. However, if your client does not change the method and makes the second request again as a POST, the server does not accept this and responds with “405 Method Not Allowed”.

Bubble follow the redirect. But also follow with the original Method, and this is the issue. There’s no way actually to change that in API Connector.

Thanks. I found the same issue after doing some google search. Is there any other platform where I can create simple POST APIs using ChatGPT.