Method: drives.insert
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
HTTP 要求
POST https://www.googleapis.com/drive/v2/drives
這個網址使用 gRPC 轉碼語法。
查詢參數
參數 |
requestId |
string
必要欄位。這個 ID (例如隨機 UUID) 可用於單一識別此使用者要求,以便建立不重複的共用雲端硬碟。如果同一位使用者重複提出相同的 ID 要求,系統就會避免嘗試建立相同的共用雲端硬碟,以免產生重複項目。如果共用雲端硬碟已存在,系統會傳回 409 錯誤。
|
回應主體
如果成功,回應主體會包含新建立的 Drive
例項。
授權範圍
需要下列 OAuth 範圍:
https://www.googleapis.com/auth/drive
部分權限受限制,應用程式必須通過安全性評估才能使用。詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["# Method: drives.insert\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- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a new shared drive.\n\n### HTTP request\n\n`POST 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| `requestId` | `string` Required. An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a shared drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same shared drive. If the shared drive already exists a 409 error will be returned. |\n\n### Request body\n\nThe request body contains an instance of [Drive](/workspace/drive/api/reference/rest/v2/drives#Drive).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Drive](/workspace/drive/api/reference/rest/v2/drives#Drive).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/drive`\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)."]]