Method: drives.list
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
درایوهای مشترک کاربر را فهرست می کند.
این روش پارامتر q
را می پذیرد، که عبارت جستجویی است که یک یا چند عبارت جستجو را ترکیب می کند. برای اطلاعات بیشتر، راهنمای جستجو برای درایوهای مشترک را ببینید.
درخواست HTTP
GET https://www.googleapis.com/drive/v2/drives
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای پرس و جو
پارامترها |
---|
maxResults | integer حداکثر تعداد درایوهای مشترک برای بازگشت در هر صفحه. |
pageToken | string نشانه صفحه برای درایوهای مشترک. |
q | string رشته جستجو برای جستجوی درایوهای مشترک. |
useDomainAdminAccess | boolean درخواست را به عنوان مدیر دامنه صادر کنید. اگر روی true تنظیم شود، تمام درایوهای مشترک دامنه ای که درخواست کننده در آن مدیر است برگردانده می شود. |
درخواست بدن
بدنه درخواست باید خالی باشد.
بدن پاسخگو
لیستی از درایوهای مشترک
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی داده هایی با ساختار زیر است:
نمایندگی JSON |
---|
{
"items": [
{
object (Drive )
}
],
"nextPageToken": string,
"kind": string
} |
فیلدها |
---|
items[] | object ( Drive ) لیست درایوهای مشترک اگر nextPageToken پر شده باشد، این لیست ممکن است ناقص باشد و یک صفحه اضافی از نتایج باید واکشی شود. |
nextPageToken | string نشانه صفحه برای صفحه بعدی درایوهای مشترک. در صورتی که به انتهای لیست رسیده باشد، وجود ندارد. اگر توکن به هر دلیلی رد شد، باید دور انداخته شود و صفحهبندی باید از صفحه اول نتایج دوباره شروع شود. |
kind | string این همیشه drive#driveList است |
محدوده مجوز
به یکی از حوزه های OAuth زیر نیاز دارد:
-
https://www.googleapis.com/auth/drive
-
https://www.googleapis.com/auth/drive.readonly
برخی از دامنه ها محدود هستند و برای استفاده از برنامه شما به ارزیابی امنیتی نیاز دارند. برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[],[],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)."]]