Osman Mazinov
Osman Mazinov

Reputation: 1436

How to obtain a resourceKey using Google Drive API?

With the recent security update for Drive document URLs and resource key https://developers.google.com/drive/api/v3/resource-keys it's not clear how to get the resource key using the API. For instance the create method doesn't return resourceKey, only id :

drive.files.create {
  resource: fileMetadata
  media: media
  fields: 'id,resourceKey,shortcutDetails'
}, (err, body) ->
  ...

Upvotes: 4

Views: 2561

Answers (1)

Jason E.
Jason E.

Reputation: 1221

The security update needs to be applied in order for the resourceKey to be useable to you.

To apply the security update:

  1. From the Admin console Home page, go to Apps and then Google Workspace and then Drive and Docs.
  2. Click Sharing settings and then Security update for files.
  3. Choose how to apply the update: -Apply the security update to all impacted files -Remove security update from all impacted files (not recommended)
  4. (Optional if applying the update) To let users remove or apply the update to files that they own or manage, check the allow box.
  5. If you made any changes, click Save.

Reference: Decide how to apply link-sharing security update to Drive

Upvotes: 2

Related Questions