使用 drive.file 范围将行附加到 Google Sheet

Append rows to a Google Sheet using drive.file scope

是否可以使用 drive.file 范围将行附加到现有的 Google Sheet?

https://www.googleapis.com/auth/drive.file 范围定义为

Per-file access to files created or opened by the app

Sheets docs

Per-file access to files created or opened by the app. File authorization is granted on a per-user basis and is revoked when the user deauthorizes the app

Drive docs.

应用程序中"opened"的Google是什么意思? Open 不是 API.

中的方法

我构建了一个使用 drive.file 范围的应用程序,该应用程序可以很好地验证和接收令牌。当我尝试向现有 Sheet 追加一行时,API 响应是 404.

如果我使用更广泛的范围 https://www.googleapis.com/auth/spreadsheets 对同一个应用程序进行身份验证,则该应用程序可以毫无问题地将行附加到同一个 Sheet。我不想使用需要应用程序验证的更广泛的范围,因为该应用程序是基于 OAuth 的插件,是一种应用程序 Google says should not require Sensitive or Restricted scopes or verification. My app also fits the criteria Google recommends for the drive.file scope here.

我发现所有这些问题几乎都是重复的并且没有明确的答案:

  1. Request specific file permissions with Google Sheets / Google Drive API
  2. AuthToken for drive.file scope returning 404
  3. Getting Google file picker to work with drive.file scope
  4. Is there anyway to get private file of user with drive.file scope

我的结论是不,不可能。我将我的应用程序设计为具有“创建 Sheet”按钮作为解决方法,并且 drive.file 范围可以很好地附加行并对我的应用程序创建的 Sheet 进行其他编辑。