Method: users.settings.delegates.create
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
新增委派帳戶,並直接將驗證狀態設為 accepted
,不需傳送任何驗證電子郵件。委派代表使用者必須與委派者使用者同屬一個 Google Workspace 機構。
Gmail 會限制 Google Workspace 機構中每位使用者可擁有的委派者和被委派者數量。這些限制取決於貴機構,但一般來說,每位使用者最多可有 25 位委派代表和 10 位委派者。
請注意,委派使用者必須使用主要電子郵件地址,而非電子郵件別名。
另請注意,建立新委派函時,最多可能需要一分鐘的時間,新委派函才可供使用。
只有已委派全網域權限的服務帳戶用戶端,才能使用這項方法。
HTTP 要求
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/settings/delegates
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
userId |
string
使用者的電子郵件地址。特殊值「me」可用來表示已驗證的使用者。
|
要求主體
要求主體包含 Delegate
的例項。
回應主體
如果成功,回應主體會包含新建立的 Delegate
例項。
授權範圍
需要下列 OAuth 範圍:
https://www.googleapis.com/auth/gmail.settings.sharing
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["# Method: users.settings.delegates.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n\nAdds a delegate with its verification status set directly to `accepted`, without sending any verification email. The delegate user must be a member of the same Google Workspace organization as the delegator user.\n\nGmail imposes limitations on the number of delegates and delegators each user in a Google Workspace organization can have. These limits depend on your organization, but in general each user can have up to 25 delegates and up to 10 delegators.\n\nNote that a delegate user must be referred to by their primary email address, and not an email alias.\n\nAlso note that when a new delegate is created, there may be up to a one minute delay before the new delegate is available for use.\n\nThis method is only available to service account clients that have been delegated domain-wide authority.\n\n### HTTP request\n\n`POST https://gmail.googleapis.com/gmail/v1/users/{userId}/settings/delegates`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-------------------------------------------------------------------------------------------------------|\n| `userId` | `string` User's email address. The special value \"me\" can be used to indicate the authenticated user. |\n\n### Request body\n\nThe request body contains an instance of [Delegate](/workspace/gmail/api/reference/rest/v1/users.settings.delegates#Delegate).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Delegate](/workspace/gmail/api/reference/rest/v1/users.settings.delegates#Delegate).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/gmail.settings.sharing`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]