How to run a Google App Script using Google API Service Library (Node.js)

前端 未结 1 796
陌清茗
陌清茗 2020-12-22 11:34

By following the Google Apps Script > Rest API Node.js quickstart example I am able to complete the authentication process (follow the link, get a token, store the token)

相关标签:
1条回答
  • 2020-12-22 11:58

    I think that your request body works. So can you confirm the following points?

    1. What version are you using? In my environment, googleapis with v25.0.0 - v30.0.0 cannot be worked. I confirmed that googleapis with v24.0.0 works fine.
      • When you use v24.0.0, if your script use var {google} = require('googleapis');, please modify to var google = require('googleapis');.
    2. Please confirm this page https://script.google.com/home/usersettings If the switch is turned off, please turn on. By this, Google Apps Script API can be used. When the switch is turned off, even if the scopes of Google Apps Script API are authorized, users cannot use the APIs.

    Note :

    • Unfortunately, after the version of v25.0.0, some bugs for APIs and the options are reported. I believe that these bugs are removed in the future. So if for APIs and the options you use, some errors occur, please modify the version of googleapis, and try again.

    References :

    • How do I update my google sheet in v4?
    • Create a gmail filter with Gmail API nodejs, Error: Filter doesn't have any criteria
    • Insufficient Permission when trying to create a folder on Google Drive via API(v3)
    • Youtube Data API V3 - Error fetching video with google.youtube.videos.list()
    • Google drive API - Cannot read property 'OAuth2' of undefined

    If these points were not useful for your situation, I'm sorry.

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