Method: roles.list
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
GET https://admin.googleapis.com/admin/directory/v1/customer/{customer}/roles
网址采用 gRPC 转码语法。
路径参数
参数 |
customer |
string
客户 Google Workspace 账号的唯一 ID。如果是多网域账号,如需提取客户的所有群组,请使用此字段,而不是 domain 。您还可以使用 my_customer 别名来表示账号的 customerId 。customerId 也会作为 Users 资源的一部分返回。您必须提供 customer 或 domain 参数。
|
查询参数
参数 |
maxResults |
integer
返回的结果数上限。
|
pageToken |
string
用于指定列表中的下一页的令牌。
|
响应正文
JSON 表示法 |
{
"kind": string,
"etag": string,
"items": [
{
object (Role )
}
],
"nextPageToken": string
} |
字段 |
kind |
string
API 资源的类型。此值始终为 admin#directory#roles 。
|
etag |
string
资源的 ETag。
|
items[] |
object (Role )
角色资源的列表。
|
nextPageToken |
string
|
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/admin.directory.rolemanagement
https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly
如需了解详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# Method: roles.list\n\nRetrieves a paginated list of all the roles in a domain.\n\n### HTTP request\n\n`GET https://admin.googleapis.com/admin/directory/v1/customer/{customer}/roles`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `customer` | `string` The unique ID for the customer's Google Workspace account. In case of a multi-domain account, to fetch all groups for a customer, use this field instead of `domain`. You can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users](https://developers.google.com/workspace/admin/directory/v1/reference/users) resource. You must provide either the `customer` or the `domain` parameter. |\n\n### Query parameters\n\n| Parameters ||\n|--------------|------------------------------------------------------|\n| `maxResults` | `integer` Maximum number of results to return. |\n| `pageToken` | `string` Token to specify the next page in the list. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"kind\": string, \"etag\": string, \"items\": [ { object (/workspace/admin/directory/reference/rest/v1/roles#Role) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|--------------------------------------------------------------------------------------------------------|\n| `kind` | `string` The type of the API resource. This is always `admin#directory#roles`. |\n| `etag` | `string` ETag of the resource. |\n| `items[]` | `object (`[Role](/workspace/admin/directory/reference/rest/v1/roles#Role)`)` A list of Role resources. |\n| `nextPageToken` | `string` |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/admin.directory.rolemanagement`\n- `\n https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]