Reputation: 371
Is it possible to append rows to an existing Google Sheet using drive.file
scope?
The https://www.googleapis.com/auth/drive.file
scope is defined as
Per-file access to files created or opened by the app
in the Sheets docs and
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
in the Drive docs.
What does Google mean by "opened" by the app? Open isn't a method in the API.
I've built an app that uses the drive.file
scope, and the app authenticates and receives tokens just fine. When I try to append a row to an existing Sheet, the API response is a 404.
If I authenticate the same app using the more broad scope https://www.googleapis.com/auth/spreadsheets
, the app has no trouble appending rows to the same Sheet. I don't want to use a more broad scope that requires app verification because the app is an OAuth based plugin, a type of app 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.
I have found all these questions that are near duplicates and have no definitive answers:
Upvotes: 1
Views: 380
Reputation: 371
I concluded no, it is not possible. I designed my app to have a "Create Sheet" button as a workaround, and the drive.file scope works fine to append rows and make other edits to a Sheet that my app creates.
Upvotes: 1