Stay organized with collections Save and categorize content based on your preferences.
You can share Google Drive files and folders with others using the Drive UI or through the Google Drive API. When you share from Drive, you can control whether people can edit, comment on, or only open the file.
A resource key helps protect your file from unintended access. Resource keys are an additional parameter that are passed so users can access certain files that have been shared using a link. Users who haven't viewed the file before must provide the resource key to gain access. Those who have recently viewed the file, or have direct access, don't need the resource key to access the file.
A Drive file that's shared with a link can only be discovered by users that can access the file as a result of a type=user
or type=group
permissions
resource. Requests from users that only have access to these link-shared files using a type=domain
or type=anyone
permission might require a resource key.
For more information about permissions, see Share files, folders and drives. For a complete list of roles and the operations permitted by each, see Roles & permissions.
Read the resource key from the fileThe Drive API returns a file's resource key on the read-only resourceKey
field of the files
resource.
If the file is a Drive shortcut, the resource key for the shortcut target is returned on the read-only shortcutDetails.targetResourceKey
field.
Fields in the files
resource that return URLs, such as exportLinks
, webContentLink
, and webViewLink
, also include the resourceKey
. Clients that integrate with the Drive UI can also use resourceKeys
within the state
parameter. For more information, see Download and export files.
Resource keys for any files referenced by requests to the Drive API are set on the X-Goog-Drive-Resource-Keys
HTTP header.
Requests to the Drive API can specify one or more resource keys with the X-Goog-Drive-Resource-Keys
HTTP header.
A file ID and resource key pair are set on the header using a forward slash (/
) separator. The header is built by combining all the file ID and resource key pairs using comma (,
) separators.
For example, consider a request to move file fileId1
from folder fileId2
to folder fileId3
. Assume the resource keys for these three files are resourceKey1
, resourceKey2
, and resourceKey3
, respectively. The header built from these values using a forward slash and comma separators is:
X-Goog-Drive-Resource-Keys: fileId1/resourceKey1,fileId2/resourceKey2,fileId3/resourceKey3
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-04 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-04 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4