Method: spaces.members.get
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
返回有关会员资格的详细信息。如需查看示例,请参阅获取有关用户或 Google Chat 应用会员资格的详细信息。
支持以下类型的身份验证:
应用身份验证,并具有以下授权范围之一:
https://www.googleapis.com/auth/chat.bot
https://www.googleapis.com/auth/chat.app.memberships
(需要管理员审批)
使用以下授权范围之一进行用户身份验证:
https://www.googleapis.com/auth/chat.memberships.readonly
https://www.googleapis.com/auth/chat.memberships
- 当管理员账号通过身份验证、
useAdminAccess
为 true
且使用以下授权范围之一时,用户身份验证会授予管理员权限:
https://www.googleapis.com/auth/chat.admin.memberships.readonly
https://www.googleapis.com/auth/chat.admin.memberships
HTTP 请求
GET https://chat.googleapis.com/v1/{name=spaces/*/members/*}
网址采用 gRPC 转码语法。
路径参数
参数 |
name |
string
必需。要检索的会员资格的资源名称。 如需通过用户身份验证获取应用自己的会员资格,您可以选择使用 spaces/{space}/members/app 。 格式:spaces/{space}/members/{member} 或 spaces/{space}/members/app 您可以使用用户的电子邮件地址作为 {member} 的别名。例如,spaces/{space}/members/example@gmail.com ,其中 example@gmail.com 是 Google Chat 用户的电子邮件地址。
|
查询参数
参数 |
useAdminAccess |
boolean
可选。如果值为 true ,则该方法会使用用户的 Google Workspace 管理员权限运行。 调用用户必须是拥有“管理聊天和聊天室对话”权限的 Google Workspace 管理员。 需要 chat.admin.memberships 或 chat.admin.memberships.readonly OAuth 2.0 范围。 使用管理员访问权限时,不支持获取空间中的应用会员资格。
|
响应正文
如果成功,则响应正文包含一个 Membership
实例。
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/chat.admin.memberships
https://www.googleapis.com/auth/chat.admin.memberships.readonly
https://www.googleapis.com/auth/chat.app.memberships
https://www.googleapis.com/auth/chat.bot
https://www.googleapis.com/auth/chat.memberships
https://www.googleapis.com/auth/chat.memberships.readonly
如需了解详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eReturns detailed information about a specific Google Chat membership within a space.\u003c/p\u003e\n"],["\u003cp\u003eSupports both app and user authentication, with an option for user authentication to leverage administrator privileges.\u003c/p\u003e\n"],["\u003cp\u003eRequires providing the membership's resource name in the request path, allowing the use of email aliases for member identification.\u003c/p\u003e\n"],["\u003cp\u003eOptionally accepts a query parameter to utilize the user's Google Workspace administrator privileges for the request.\u003c/p\u003e\n"],["\u003cp\u003eNeeds authorization with specific OAuth scopes related to Chat memberships and administration.\u003c/p\u003e\n"]]],["This document outlines how to retrieve membership details using a `GET` request to `https://chat.googleapis.com/v1/{name=spaces/*/members/*}`. The `name` path parameter specifies the membership, with options to use a user's email as an alias. The `useAdminAccess` query parameter allows for execution with Google Workspace administrator privileges. The request body should be empty; a successful response contains a `Membership` instance. The operation requires various authorization scopes, including `chat.admin.memberships`.\n"],null,["# Method: spaces.members.get\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\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\nReturns details about a membership. For an example, see [Get details about a user's or Google Chat app's membership](https://developers.google.com/workspace/chat/get-members).\n\nSupports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):\n\n- [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with one of the following authorization scopes:\n\n - `https://www.googleapis.com/auth/chat.bot`\n - `https://www.googleapis.com/auth/chat.app.memberships` (requires [administrator approval](https://support.google.com/a?p=chat-app-auth))\n- [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes:\n\n - `https://www.googleapis.com/auth/chat.memberships.readonly`\n - `https://www.googleapis.com/auth/chat.memberships`\n - User authentication grants administrator privileges when an administrator account authenticates, `useAdminAccess` is `true`, and one of the following authorization scopes is used:\n - `https://www.googleapis.com/auth/chat.admin.memberships.readonly`\n - `https://www.googleapis.com/auth/chat.admin.memberships`\n\n### HTTP request\n\n`GET https://chat.googleapis.com/v1/{name=spaces/*/members/*}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. Resource name of the membership to retrieve. To get the app's own membership [by using user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), you can optionally use `spaces/{space}/members/app`. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` You can use the user's email as an alias for `{member}`. For example, `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user. |\n\n### Query parameters\n\n| Parameters ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `useAdminAccess` | `boolean` Optional. When `true`, the method runs using the user's Google Workspace administrator privileges. The calling user must be a Google Workspace administrator with the [manage chat and spaces conversations privilege](https://support.google.com/a/answer/13369245). Requires the `chat.admin.memberships` or `chat.admin.memberships.readonly` [OAuth 2.0 scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). Getting app memberships in a space isn't supported when using admin access. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [Membership](/workspace/chat/api/reference/rest/v1/spaces.members#Membership).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/chat.admin.memberships`\n- `https://www.googleapis.com/auth/chat.admin.memberships.readonly`\n- `https://www.googleapis.com/auth/chat.app.memberships`\n- `https://www.googleapis.com/auth/chat.bot`\n- `https://www.googleapis.com/auth/chat.memberships`\n- `https://www.googleapis.com/auth/chat.memberships.readonly`\n\nFor more information, see the [Authorization guide](/workspace/chat/authenticate-authorize)."]]