ACL của một lối tắt sẽ kế thừa ACL của thư mục mẹ. Bạn không thể thay đổi danh sách kiểm soát truy cập (ACL) của lối tắt một cách trực tiếp.
Một targetId trỏ đến tệp hoặc thư mục đích, còn được gọi là "đích".
Một targetMimeType cho biết loại MIME của mục tiêu. targetMimeType được dùng để xác định biểu tượng loại cần hiển thị. Loại MIME của đích đến sẽ được sao chép vào trường targetMimeType khi lối tắt được tạo.
Các trường targetId và targetMimeType là một phần của trường shortcutDetails trong tài nguyên file.
Một lối tắt chỉ có thể có một thư mục mẹ. Nếu cần có tệp lối tắt ở các vị trí khác trên Drive, bạn có thể sao chép tệp lối tắt đó sang các vị trí bổ sung.
Khi đích đến bị xoá hoặc khi người dùng hiện tại mất quyền truy cập vào đích đến, lối tắt của người dùng trỏ đến đích đến sẽ bị hỏng.
Tiêu đề của một lối tắt có thể khác với mục tiêu. Khi một lối tắt được tạo, tiêu đề của mục tiêu sẽ được dùng làm tiêu đề của lối tắt. Sau khi tạo, bạn có thể thay đổi tiêu đề của lối tắt và tiêu đề của mục tiêu một cách độc lập. Nếu tên của mục tiêu thay đổi, các lối tắt đã tạo trước đó sẽ giữ lại tiêu đề cũ.
Loại MIME của một lối tắt có thể trở nên lỗi thời. Mặc dù hiếm gặp, nhưng loại MIME của tệp blob sẽ thay đổi khi một phiên bản sửa đổi thuộc loại khác được tải lên, nhưng mọi lối tắt trỏ đến tệp đã cập nhật đều giữ lại loại MIME ban đầu. Ví dụ: nếu bạn tải một tệp JPG lên Drive, sau đó tải một bản sửa đổi AVI lên, Drive sẽ xác định được thay đổi và cập nhật hình thu nhỏ cho tệp thực tế. Tuy nhiên, lối tắt vẫn có hình thu nhỏ JPG.
Trong Google Account Data Export (Xuất dữ liệu tài khoản Google), còn được gọi là Google Takeout, các lối tắt được biểu thị dưới dạng tệp dấu trang Netscape chứa các đường liên kết đến mục tiêu.
Để tạo lối tắt, hãy đặt loại MIME thành application/vnd.google-apps.shortcut, đặt targetId thành tệp hoặc thư mục mà lối tắt sẽ liên kết đến, rồi gọi files.create để tạo lối tắt.
Các ví dụ sau đây cho thấy cách tạo lối tắt bằng thư viện ứng dụng:
Theo mặc định, lối tắt sẽ được tạo trên phần My Drive của người dùng hiện tại và lối tắt chỉ được tạo cho những tệp hoặc thư mục mà người dùng hiện tại có quyền truy cập.
Tìm lối tắt
Để tìm một phím tắt, hãy dùng chuỗi truy vấn q với files.list để lọc các phím tắt cần trả về.
mimeType operator values
Trong trường hợp:
query_term là cụm từ tìm kiếm hoặc trường cần tìm kiếm. Để xem các cụm từ tìm kiếm có thể dùng để lọc bộ nhớ dùng chung, hãy tham khảo Cụm từ tìm kiếm.
toán tử chỉ định điều kiện cho cụm từ tìm kiếm. Để xem những toán tử bạn có thể dùng với từng cụm từ tìm kiếm, hãy tham khảo phần Toán tử truy vấn.
giá trị là những giá trị cụ thể mà bạn muốn dùng để lọc kết quả tìm kiếm.
Ví dụ: chuỗi truy vấn sau sẽ lọc nội dung tìm kiếm để trả về tất cả các lối tắt đến tệp bảng tính:
[null,null,["Cập nhật lần gần đây nhất: 2025-08-29 UTC."],[],[],null,["# Create a shortcut to a Drive file\n\n*Shortcuts* are files that link to other files or folders on Google Drive.\nShortcuts have these characteristics:\n\n- An `application/vnd.google-apps.shortcut` MIME type. For more information,\n see [Google Workspace \\& Google Drive supported MIME\n types](/workspace/drive/api/guides/mime-types).\n\n- The ACL for a shortcut inherits the ACL of the parent. The shortcut's ACL\n cannot be changed directly.\n\n- A `targetId` pointing to the target file or folder, also referred to as the\n \"target.\"\n\n- A `targetMimeType` indicating the MIME type for the target. The\n `targetMimeType` is used to determine the type icon to display. The target's\n MIME type is copied to the `targetMimeType` field when the shortcut is\n created.\n\n- The `targetId` and `targetMimeType` fields are part of the `shortcutDetails`\n field within the [file](/workspace/drive/api/reference/rest/v3/files) resource.\n\n- A shortcut can only have one parent. If a shortcut file is required in other\n Drive locations, the shortcut file can be copied to the\n additional locations.\n\n- When the target is deleted, or when the current user loses access to the\n target, the user's shortcut pointing to the target breaks.\n\n- The title of a shortcut can differ from the target. When a shortcut is\n created, the title of the target is used as the title of the shortcut. After\n creation, the shortcut's title and target's title can be changed\n independently. If the target's name is changed, previously created shortcuts\n retain the old title.\n\n- The MIME type of a shortcut can become stale. While rare, a blob file's MIME\n type changes when a revision of a different type is uploaded, but any\n shortcuts pointing to the updated file retain the original MIME type. For\n example, if you upload a JPG file to Drive, then upload an\n AVI revision, Drive identifies the change and updates the\n thumbnail for the actual file. However, the shortcut continues to have a JPG\n thumbnail.\n\n- In [Google Account Data\n Export](https://support.google.com/accounts/answer/3024190)\n also known as Google Takeout, shortcuts are represented as Netscape\n bookmark files containing links to the target.\n\nFor more information, see [Find files \\& folders with Google Drive\nshortcuts](https://support.google.com/drive/answer/9700156)\n.\n| **Important:** Previously, shortcuts were the term for files that pointed to content stored by an application. That type of \"shortcut\" was renamed to *third-party shortcut* . For further information, see [Create a shortcut file to\n| content stored by your app](/workspace/drive/api/guides/third-party-shortcuts).\n\nCreate a shortcut\n-----------------\n\nTo create a shortcut, set the MIME type to\n`application/vnd.google-apps.shortcut`, set the `targetId` to the file or folder\nthe shortcut should link to, and call [`files.create`](/workspace/drive/api/reference/rest/v3/files/create) to create a shortcut.\n| **Note:** If you're using V2 of the API, use [`files.insert`](/workspace/drive/api/v2/reference/files/insert).\n\nThe following examples show how to create a shortcut using a client library: \n\n### Python\n\n file_metadata = {\n 'name': '\u003cvar translate=\"no\"\u003eFILE_NAME\u003c/var\u003e',\n 'mimeType': 'text/plain'\n }\n file = drive_service.files().create(body=file_metadata, fields='id').execute()\n print('File ID: %s' % file.get('id'))\n shortcut_metadata = {\n 'Name': '\u003cvar translate=\"no\"\u003eSHORTCUT_NAME\u003c/var\u003e',\n 'mimeType': 'application/vnd.google-apps.shortcut',\n 'shortcutDetails': {\n 'targetId': file.get('id')\n }\n }\n shortcut = drive_service.files().create(body=shortcut_metadata,\n fields='id,shortcutDetails').execute()\n print('File ID: %s, Shortcut Target ID: %s, Shortcut Target MIME type: %s' % (\n shortcut.get('id'),\n shortcut.get('shortcutDetails').get('targetId'),\n shortcut.get('shortcutDetails').get('targetMimeType')))\n\n### Node.js\n\n var fileMetadata = {\n 'name': '\u003cvar translate=\"no\"\u003eFILE_NAME\u003c/var\u003e',\n 'mimeType': 'text/plain'\n };\n drive.files.create({\n 'resource': fileMetadata,\n 'fields': 'id'\n }, function (err, file) {\n if (err) {\n // Handle error\n console.error(err);\n } else {\n console.log('File Id: ' + file.id);\n shortcutMetadata = {\n 'name': '\u003cvar translate=\"no\"\u003eSHORTCUT_NAME\u003c/var\u003e',\n 'mimeType': 'application/vnd.google-apps.shortcut'\n 'shortcutDetails': {\n 'targetId': file.id\n }\n };\n drive.files.create({\n 'resource': shortcutMetadata,\n 'fields': 'id,name,mimeType,shortcutDetails'\n }, function(err, shortcut) {\n if (err) {\n // Handle error\n console.error(err);\n } else {\n console.log('Shortcut Id: ' + shortcut.id +\n ', Name: ' + shortcut.name +\n ', target Id: ' + shortcut.shortcutDetails.targetId +\n ', target MIME type: ' + shortcut.shortcutDetails.targetMimeType);\n }\n }\n }\n });\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eFILE_NAME\u003c/var\u003e: the file name requiring a shortcut.\n- \u003cvar translate=\"no\"\u003eSHORTCUT_NAME\u003c/var\u003e: the name for this shortcut.\n\nBy default, the shortcut is created on the current user's My\nDrive and shortcuts are only created for files or folders for\nwhich the current user has access.\n\nSearch for a shortcut\n---------------------\n\nTo search for a shortcut, use the query string `q` with\n[`files.list`](/workspace/drive/api/v3/reference/files/list) to filter the shortcuts to\nreturn.\n\n`mimeType `*operator values*\n\nWhere:\n\n- *query_term* is the query term or field to search upon. To view the query terms that can be used to filter shared drives, refer to [Search query\n terms](/workspace/drive/api/guides/ref-search-terms#file_properties).\n- *operator* specifies the condition for the query term. To view which operators you can use with each query term, refer to [Query operators](/workspace/drive/api/guides/ref-search-terms#operators).\n- *values* are the specific values you want to use to filter your search results.\n\nFor example, the following query string filters the search to return all\nshortcuts to spreadsheet files: \n\n q: mimeType='application/vnd.google-apps.shortcut' AND shortcutDetails.targetMimeType='application/vnd.google-apps.spreadsheet'"]]