404 error when using Apps Script Execution API in Python -


i keep getting 404 error when trying use apps script execution api. i've made sure project id correctly linked, , correct api turned on.

this traceback i'm getting:

traceback (most recent call last):   file "", line 70, in main     response = service.scripts().run(body=request, scriptid=script_id).execute()   file "/oauth2client/util.py", line 137, in positional_wrapper     return wrapped(*args, **kwargs)   file "apiclient/http.py", line 723, in execute     raise httperror(resp, content, uri=self.uri) apiclient.errors.httperror: <httperror 404 when requesting https://script.googleapis.com/v1/scripts/asfdqetwrqwefas12341234:run?alt=json returned "requested entity not found."> 

this code i'm using:

scopes = ['https://mail.google.com/',           'https://www.googleapis.com/auth/drive',           'https://www.googleapis.com/auth/spreadsheets']  script_id = 'asfdqetwrqwefas12341234'  client_secret = '/file/path'  def get_credentials():   open(client_secret, 'r') f:     content = json.load(f)   credentials = client.signedjwtassertioncredentials(       content['client_email'], content['private_key'].encode(), scopes)   if hasattr(credentials, 'access_token'):     if (hasattr(credentials, 'access_token_expired') ,         credentials.access_token_expired):       http = httplib2.http()       credentials.refresh(http)   return credentials  def main(unused_argv):   credentials = get_credentials()   http = credentials.authorize(httplib2.http())   service = build('script', 'v1', http=http)   request = {              'function': 'test',              'devmode': true             }   response = service.scripts().run(body=request, scriptid=script_id).execute()   if 'error' in response:     raise appsscripterror(response['error'])   try:     assert str(response['response']['result']) == 'success!'   except:     raise appsscripterror('apps script didn\'t complete successfully.') 

it looks have go script project, publish > deploy api executable , choose who has access script - anyone.


Comments