kdoker
kdoker

Reputation: 516

How to allow viewers to download a file through Google Drive API

There is a setting in Google Drive file sharing called 'Viewers and commenters can see the option to download, print, and copy'. It is false by default. I would like to enable it for some files programmatically so viewers could download them. I already have a service that changes permissions for files on Google Drive, but I don't see any API that corresponds to this setting: https://developers.google.com/drive/api/v3/manage-sharing

Upvotes: 1

Views: 1205

Answers (1)

Iamblichus
Iamblichus

Reputation: 19309

Use copyRequiresWriterPermission:

The option Viewers and commenters can see the option to download, print, and copy corresponds in the API to the following field from File:

copyRequiresWriterPermission

Call Files: update and specify this property in the request body in order to modify this:

{
  "copyRequiresWriterPermission": true
}

Upvotes: 1

Related Questions