Method: drives.list
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Liệt kê bộ nhớ dùng chung của người dùng.
Phương thức này chấp nhận tham số q
, là một cụm từ tìm kiếm kết hợp một hoặc nhiều cụm từ tìm kiếm. Để biết thêm thông tin, hãy xem hướng dẫn Tìm bộ nhớ dùng chung.
Yêu cầu HTTP
GET https://www.googleapis.com/drive/v2/drives
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số truy vấn
Thông số |
maxResults |
integer
Số lượng bộ nhớ dùng chung tối đa cần trả về trên mỗi trang.
|
pageToken |
string
Mã thông báo trang cho bộ nhớ dùng chung.
|
q |
string
Chuỗi truy vấn để tìm kiếm bộ nhớ dùng chung.
|
useDomainAdminAccess |
boolean
Đưa ra yêu cầu với tư cách là quản trị viên miền; nếu được đặt thành true, thì tất cả các bộ nhớ dùng chung của miền mà người yêu cầu là quản trị viên sẽ được trả về.
|
Nội dung yêu cầu
Nội dung yêu cầu phải trống.
Nội dung phản hồi
Danh sách bộ nhớ dùng chung.
Nếu thành công, phần nội dung phản hồi sẽ chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"items": [
{
object (Drive )
}
],
"nextPageToken": string,
"kind": string
} |
Trường |
items[] |
object (Drive )
Danh sách bộ nhớ dùng chung. Nếu nextPageToken được điền sẵn, thì danh sách này có thể chưa đầy đủ và bạn nên tìm nạp thêm một trang kết quả.
|
nextPageToken |
string
Mã thông báo trang cho trang tiếp theo của bộ nhớ dùng chung. Tham số này sẽ không xuất hiện nếu bạn đã đến cuối danh sách. Nếu mã thông báo bị từ chối vì bất kỳ lý do nào, mã thông báo đó sẽ bị loại bỏ và việc phân trang sẽ được bắt đầu lại từ trang kết quả đầu tiên.
|
kind |
string
Đây luôn là drive#driveList
|
Phạm vi uỷ quyền
Yêu cầu một trong các phạm vi OAuth sau:
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.readonly
Một số phạm vi bị hạn chế và yêu cầu bạn phải đánh giá bảo mật để ứng dụng của bạn có thể sử dụng các phạm vi đó. Để biết thêm thông tin, hãy xem Hướng dẫn uỷ quyền.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],[],null,["# Method: drives.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.DriveList.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\n\u003cbr /\u003e\n\nLists the user's shared drives.\n\nThis method accepts the `q` parameter, which is a search query combining one or more search terms. For more information, see the [Search for shared drives](/workspace/drive/api/guides/search-shareddrives) guide.\n\n### HTTP request\n\n`GET https://www.googleapis.com/drive/v2/drives`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `maxResults` | `integer` Maximum number of shared drives to return per page. |\n| `pageToken` | `string` Page token for shared drives. |\n| `q` | `string` Query string for searching shared drives. |\n| `useDomainAdminAccess` | `boolean` Issue the request as a domain administrator; if set to true, then all shared drives of the domain in which the requester is an administrator are returned. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nA list of shared drives.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"items\": [ { object (/workspace/drive/api/reference/rest/v2/drives#Drive) } ], \"nextPageToken\": string, \"kind\": string } ``` |\n\n| Fields ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `items[]` | `object (`[Drive](/workspace/drive/api/reference/rest/v2/drives#Drive)`)` The list of shared drives. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. |\n| `nextPageToken` | `string` The page token for the next page of shared drives. This will be absent if the end of the list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. |\n| `kind` | `string` This is always `drive#driveList` |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/drive`\n- `\n https://www.googleapis.com/auth/drive.readonly`\n\nSome scopes are restricted and require a security assessment for your app to use them. For more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]