Hi,
I'm trying to create a board button that sends a get request to my Google App Script(GAS). GAS always generates a one-time accessing uri and returns as response 302. Unfortunately, butler doesn't recognize it and treat it as an error. Does anyone know how to recognize a redirection response and proceed the execution with redirect uri?
Thank you in advance!
@Jiajie Liu Google Apps Script doesn't generate a one-time access URL if you deploy it as a web application
Hi Iain Dooley!
Thank you for you reply!
I deployed it as a web application and I have an URL like this
https://script.google.com/macros/s/<somethinghere>/exec
and it returns a redirect response to
https://script.googleusercontent.com/macros/echo?user_content_key=...
The script executes as Me and anyone even anonymous can access to the app since I don't know how to do OAuth in bulter.
I think this Google App Script related question should not be asked here so is there any way to handle the response 302 in butler? Or other power-up that I could do some coding inside.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jiajie Liu looks like this is only the case when you serve the request using the Content Service:
https://developers.google.com/apps-script/guides/content
If you serve the request using the HTML Service instead you won't get the redirect:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much! It works now.
Thank you again for helping me to solve my problem even it's not about trello.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jiajie Liu haha yeah I do a LOT of work with Google Apps Script, in fact I created this framework for automating Trello "butler style" using GAS:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, after 4 hours trying to link a simple GAS script to Butler via GET Rest, this answer is the closest thing I can get from solving my problem, but not quite there yet....
In my case I get the Error 302, and my code was
return ContentService .createTextOutput(JSON.stringify({"result":"success", "novocnpj": novocnpj})) .setMimeType(ContentService.MimeType.JSON);
novocnpj is the variable that I want to get back to Trello using httpresponse
When I change to HTML Service the only way is like below:
return HtmlService.createHtmlOutput(JSON.stringify({"result":"success", "novocnpj": novocnpj}));
But that also doesn't work.... it services a webpage and not a JSON... so httpresponse doesnt work
please tell me what I am missing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.