API Error 302 - failed redirect

Hello

I’ve got several Google Apps Scripts, running as web apps, which up until early April were working perfectly.

Now they all fail with a HTTP 302.

Running the exact same API call in postman works perfectly.

Has Glide changed the way API calls handle redirects???

I have changed the new Error handling option in the API call to “Ignore but return all errors” - and now of course get an HTML response with a title “Moved Temporarily” and a link to the new location.

All my Google Apps Scripts are set to run as “Anyone”. I have seen on forums the option to run as “Anyone, even anonymous” - but I don’t have that option.

Any help much appreciated.

Andrew

1 Like

I agree. Glide must change that as soon as possible.

1 Like

I can’t find any mention of this in a change log or anything.

Does this affect API calls to other platforms aside from Google Apps?

Very frustrating.

Now I know it’s not me, I’ll raise a support ticket.

I heard back from support

“I heard back from Engineering. Your script is failing because we plugged a security issue that surfaced. As a result of that fix, we no longer allow redirects.”

I am not an expert, so I don’t know how much of a security risk this is - but it leaves me rather stuck. I’ve spent ages developing Google Apps Scripts - got them working perfectly - and now I can’t use them at all.

Anyone know any other options?

So you’re trying POST calls and automatically gets 302?

Correct

I am using Google apps script - prefer it to Make.

Every call to a Google Apps Script web app incurs a redirect which causes Glide to stop and return a 302

Was working perfectly for several months.

Is there a possibility of using a GET request instead of POST (using Call API though, not Trigger Webhook).

Hello all

Just thought I’d follow up on this (redirects failing from Glide API requests)

Had a very helpful reply from support explaining that redirects are disabled as they can be a security risk.

So I did some digging and now see that Google Apps Scripts are really intended for small basic scripts as extensions to Google sheets / docs.

So I wasn’t really using the right tool for the job. I guess a clue was in the name!

So I’ve spent some time learning / re coding my scripts as Google Functions which I get access to through my Google Cloud account (as I did apps scripts)

But glad I did move to cloud functions as they are so much more powerful and robust. Took a while to make the move, but I’ve learned loads and so have benefited from it.

Andrew

4 Likes

Is it hard to deploy them as Google Functions? At that point, I assume it serves like an API you can call and get something executd, is that correct?

Not hard at all! Very easy

Exactly that - Glide calls it as an API (I’ve added an api key too) and you get a JSON response

Took a couple of days and some late nights but it’s working so well and is blistering fast at generating PDFs. Learnt loads in the process.

Even better - haven’t paid an extra penny for them (as my business uses Google for email etc). Hope I don’t come up against

I’ve written another function (as well as the PDF generator) that interfaces between Glide and FreeAgent - my business’s accounting software.

Just hope I don’t come up against any more gotchas!

1 Like

You should put together a tutorial :slightly_smiling_face:

1 Like

Oh I am not that good! I just fudge my way through it to be honest!