0

On a server, I have a cron job which calls a python script. I want the python script to be able to call a google app script function, which performs some actions on a google spreadsheet.

Is it possible to call a google app script from python and also get notified when it finishes?

apadana
  • 13,456
  • 15
  • 82
  • 98
  • 1
    I'm not sure about what happens on the python side, but you can call an Apps Script project over the internet with either a GET or PUT HTTPS Request, and have Apps Script return something. So, make a GET or PUT request from python to the Published URL of an Apps Script Web App. Apps Script has two reserved function names called `doGet()` and `doPost()`. If those function names exist, they monitor for an event. The event being a GET or POST request to the published URL of the Web App. – Alan Wells Mar 16 '17 at 14:52
  • Also see: [Link to Stack Overflow question](http://stackoverflow.com/questions/30126787/call-a-custom-gas-function-from-external-url) – Alan Wells Mar 16 '17 at 14:52
  • How about any api (app script api)? Specially I don't want to publish my app script to public. So something like an oauth authorization and then calling an api was in my mind. – apadana Mar 16 '17 at 15:01
  • 1
    There is no Apps Script API. If the Apps Script Web App is published to run as YOU, then you'll need to go through the OAuth anyway. You can create a separate stand alone Apps Script project, just for that one process, and never show the URL to anyone. – Alan Wells Mar 16 '17 at 15:09

0 Answers0