Method: accounts.list
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
列出经过身份验证的用户的所有账号。这包括用户拥有的所有账号,以及用户拥有管理权限的所有账号。
HTTP 请求
GET https://mybusinessaccountmanagement.googleapis.com/v1/accounts
网址采用 gRPC 转码语法。
查询参数
参数 |
parentAccount |
string
可选。要检索可直接访问的账号列表的账号的资源名称。这仅适用于组织和用户组。如果为空,则针对经过身份验证的用户返回 accounts.list 。accounts/{account_id} 。
|
pageSize |
integer
可选。每页提取的账号数量。默认值和最大值为 20。
|
pageToken |
string
可选。如果指定,则检索到账号的下一页。当调用 accounts.list 返回的结果数超过所请求的页面大小所能容纳的数量时,系统会返回 pageToken 。
|
filter |
string
可选。限制要返回的账号的过滤条件。响应仅包含与过滤条件匹配的条目。如果 filter 为空,则系统不会应用任何限制条件,并且系统将为所请求的账号检索所有账号(已分页)。 例如,包含过滤条件 type=USER_GROUP 的请求将仅返回用户组。 type 字段是唯一受支持的过滤条件。
|
响应正文
Accounts.ListAccounts 的响应消息。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"accounts": [
{
object (Account )
}
],
"nextPageToken": string
} |
字段 |
accounts[] |
object (Account )
用户有访问权限的一组账号。执行查询的用户的个人账号将始终是结果的第一项,除非它被滤除。
|
nextPageToken |
string
如果账号数量超过所请求的页面大小,系统会使用令牌填充此字段,以在后续调用 accounts.list 时获取下一页账号。如果没有更多账号,则响应中不会显示此字段。
|
授权范围
需要以下 OAuth 范围:
https://www.googleapis.com/auth/business.manage
如需了解详情,请参阅 OAuth 2.0 概览。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-10-14。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-10-14。"],[[["Lists all accounts owned by or accessible to the authenticated user, including their personal account."],["Allows filtering accounts by type and specifying the parent account for retrieval."],["Supports pagination to retrieve large lists of accounts using `pageToken`."],["The response includes an array of `Account` objects and a `nextPageToken` for further results."],["Requires the `https://www.googleapis.com/auth/business.manage` OAuth scope for authorization."]]],["This API retrieves a list of accounts for an authenticated user via a `GET` request to a specified URL. The user can filter the accounts by type, specify the page size, and use a `pageToken` for pagination. An optional `parentAccount` parameter retrieves accounts directly accessible from that account. The request body must be empty, and the successful response includes an array of account objects and, if applicable, a `nextPageToken` for further pagination. This uses OAuth 2.0 with the `business.manage` scope.\n"]]