Can the Google Apps Script Execution API be called by a service account?

后端 未结 3 769
青春惊慌失措
青春惊慌失措 2020-12-16 17:51

I\'d like to use a service account to access a Google Sheet via the Apps Script Execution API, but it\'s not clear from the documentation whether this is supported.

相关标签:
3条回答
  • 2020-12-16 18:36

    Currently(2020), Service accounts cannot work with Apps script API. As written in the documentation,

    Warning: The Apps Script API does not work with service accounts.

    0 讨论(0)
  • 2020-12-16 18:50

    Your original 403 error indicates that you have incorrectly set up authentication for your service account. However, even if you get that working, as of now (10 Nov 2015) you cannot execute Apps Scripts via the Service Account.

    It's a known bug, and is being tracked in the Apps Scripts Issue Tracker.

    0 讨论(0)
  • 2020-12-16 18:54

    Your problem is probably that the script is associated with the wrong project (i.e. its own project, instead of the project associated with your Service Account). Here is what you need to do:

    From the Scripts editor select the following menu item: Resources > Developer Console Project.

    On this screen enter the project number for your dev console.

    cf this answer

    0 讨论(0)
提交回复
热议问题