Third-party shortcuts in Google Drive are metadata-only files that link to other files on external, third-party owned, storage systems. These shortcuts act as reference links to the "content" files stored by an application outside of Drive, usually in a different datastore or cloud storage system.
To create a third-party shortcut, use the files.create
method of the Google Drive API and set
the MIME type to application/vnd.google-apps.drive-sdk
. Don't upload any
content when creating the file. For more information, see Google Workspace
and Google Drive supported MIME types.
You cannot upload or download third-party shortcuts.
The following code samples show how to create a third-party shortcut using a client library:
Java
Python
PHP
.NET
Node.js
How third-party shortcuts work
When you create a third-party shortcut using the files.create
method, it uses
a POST
request to insert the metadata and create a shortcut to your app's
content:
POST https://www.googleapis.com/drive/v3/files
Authorization: AUTHORIZATION_HEADER
{
"title": "FILE_TITLE",
"mimeType": "application/vnd.google-apps.drive-sdk"
}
When the third-party shortcut is clicked, the user is redirected to the external
site where the file is housed. The Drive file ID is contained in
the state
parameter. For more
information, see Handle an Open URL for app-specific
documents.
The third-party app or website is then responsible for matching the file ID in
the state
parameter to the content housed within their system.
Add custom thumbnails and indexable text
To increase the discoverability of files associated with third-party shortcuts, you can upload both thumbnail images and indexable text when inserting or modifying the file metadata. For more information, see Manage file metadata.
Related topics
- Create a shortcut to a Drive file
- Configure a Drive UI integration
- Google Workspace and Google Drive supported MIME types