Accounts: insert
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
需要授权
为用户插入新账号
请求
HTTP 请求
POST https://www.googleapis.com/mirror/v1/accounts/userToken/accountType/accountName
参数
参数名称 |
值 |
说明 |
路径参数 |
accountName |
string |
要传递给 Android 账号管理器的账号名称。
|
accountType |
string |
要传递给 Android 账号管理器的账号类型。
|
userToken |
string |
用户的 ID。
|
授权
此请求需要获得下列范围的授权(详细了解身份验证和授权)。
请求正文
在请求正文中,提供一项 Accounts 资源。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eInserts a new user account, requiring authorization with specified scope.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes a POST request to a designated endpoint with account name, type, and user ID.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires an Accounts resource and a successful response returns the same.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization is necessary and details regarding authentication and authorization can be found in the provided documentation link.\u003c/p\u003e\n"]]],[],null,["# Accounts: insert\n\n**Requires [authorization](#auth)**\n\nInserts a new account for a user\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/mirror/v1/accounts/userToken/accountType/accountName\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|----------------|----------|----------------------------------------------------------------------|\n| **Path parameters** |||\n| `accountName` | `string` | The name of the account to be passed to the Android Account Manager. |\n| `accountType` | `string` | Account type to be passed to Android Account Manager. |\n| `userToken` | `string` | The ID for the user. |\n\n### Authorization\n\nThis request requires authorization with the following scope ([read more about authentication and authorization](/glass/authorization)).\n\n| Scope |\n|-------|\n\n### Request body\n\nIn the request body, supply an [Accounts resource](/glass/v1/reference/accounts#resource).\n\nResponse\n--------\n\nIf successful, this method returns an [Accounts resource](/glass/v1/reference/accounts#resource) in the response body."]]