I have a backend service and some users with data in their Google Sheets. I want my service to fetch and modify data in those sheets on behalf of their owners. So I've written a two-part solution:
The Script editor code containing doGet and doPost functions The Library imported into that Script. This Library actually does all the heavy lifting. A simplified version of the Script:
function doGet(req) {
// Let Mylib handle this
return Mylib.handleGET(req);
}
function doPost(req) {
// Let Mylib handle this
return Mylib.handlePOST(req);
}
A user exposes his Spreadsheet to the world via Publish -> Deploy as web app... and provide the resultant Web App url to my service.
This works pretty much good, except that I don't want to bother my users to update version of the Library and then redeploy the app every time I release an update to the Library. So I thought that implementing the Library as an Editor Addon would be an elegant solution for my case, but I can't seem to reach the Addon's handleGET and handlePOST functions from the Editor script now.
Any ideas how can this be still implemented? Or maybe there is a better way?
webappparameters in the manifest in order to publish web app with Addon installation. As it turned out, the web app was not deployed individually for every Spreadsheet a user enables this Addon in. Apparently, the Web App was deployed only once globally as theScriptApp.getService().getUrl();always showed the same url no matter what user installs the Addon. - cyxouevalis a potential security loop hole. If someone was able to intercept urlFetch/change link, it'll be a nightmare. - TheMaster