Sukanya Y
Sukanya Y

Reputation: 1

What is the minimal scope required for copying a file to google drive

I am trying to copy a file from my app to google drive.I am unable to do so using the scopes drive.file and drive.metadata but able to do so by drive scope. Since drive scope gives more access than needed i want to keep only the required scope for file copy.

  1. Please let me know the minimal scope that is required for file copy.

  2. Also want to know if the order or scope definition matters here like if passing the scope as "drive.file drive metadata" differs from "drive.metatdata drive.file".

Any advice or suggestions will be greatly appreciated.

Upvotes: 0

Views: 527

Answers (2)

Sang Dang
Sang Dang

Reputation: 489

It does not write clearly in the documentation, but I only found out today, that the https://www.googleapis.com/auth/drive.file give you just enough permission to copy files inside of your own Drive. If you want to copy from someone else Drive, it needs to have https://www.googleapis.com/auth/drive.

Upvotes: 0

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116968

In order to copy a file you are going to need write access to the drive account file.create

This request requires authorization with at least one of the following scopes (read more about authentication and authorization).

If you have tried with https://www.googleapis.com/auth/drive.file i suggest that you try to refresh your authentication if you changed the scopes in your application without authenticating the user you will not have access using the old scopes.

Upvotes: 1

Related Questions