google-apps-scriptgoogle-drive-apigoogle-oauthgoogle-slides-api

Can Slides API use only drive.file scope


I oauth verification for the Slides add-on. OAuth Dev verification point next mail.

Minimum Scope Requirement You requested the following sensitive scope(s):

https://www.googleapis.com/auth/presentations Please review the following information to understand if the drive.file scope is a better fit for your application. If your request does not meet the eligibility requirements outlined below, we won’t be able to grant your request for restricted Drive APIs.

Google Slides API reference wrote

Authorization scopes

Requires one of the following OAuth scopes:

https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive.readonly https://www.googleapis.com/auth/presentations

but i understand to use slides api needs drive.file and presentations or presentations.currentonly.

I replay that.but verification replay same. use drive.file insted presentations.

Is it my mistake? Can Slide api use only drive.file scope

I tested delete auth/presentations, but error occured

Exception: Specified permissions are not sufficient to call SlidesApp.getActivePresentation. Required permissions: (https://www.googleapis.com/auth/presentations.currentonly || https://www.googleapis.com/auth/presentations)


Solution

  • Slides API can use drive.file scope1, but Apps script inbuilt methods like SlidesApp.getActivePresentation() cannot2. It is possible to directly access the api through UrlFetchApp3.

    Furthermore, drive.file scope can only be used if the user explicitly grants access to the file using 4 or if the script created the file5.