如何通过Cloud Identity REST API按displayName搜索群组?
问题:Cloud Identity API通过displayName检索群组返回400错误
我尝试使用Cloud Identity REST API通过displayName检索群组。根据官方文档,应使用search方法并传入以下查询参数:
parent == 'customers/{customerId}' && displayName == '{groupName}'
但请求返回400错误:
HTTP/1.1 400 cache-control: private content-encoding: gzip content-length: 129 content-type: application/json; charset=UTF-8 date: Tue, 25 Apr 2023 08:24:44 GMT server: ESF vary: Origin, X-Origin, Referer { "error": { "code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT" } }
为排查查询语法问题,我测试了以下几种查询语句:
| 查询语句 | 响应结果 |
|---|---|
parent == 'customers/{customerId}' | 成功 |
parent == 'customers/{customerId}' && 'cloudidentity.googleapis.com/groups.discussion_forum' in labels | 成功 |
parent == 'customers/{customerId}' && domain_name == '{domain}' | 成功 |
parent == 'customers/{customerId}' && groupKey == '{groupEmail}' | 失败 |
parent == 'customers/{customerId}' && displayName.contains('{groupName}') | 失败 |
parent == 'customers/{customerId}' && 'cloudidentity.googleapis.com/groups.discussion_forum' in labels && displayName == '{groupName}' | 失败 |
显然问题出在使用displayName或groupKey参数的查询中。
我是否遗漏了什么?我曾怀疑是用户权限或Google Workspace/Cloud Identity层级/配置问题,但根据官方文档,这类问题应返回403错误,而非当前的400错误。
内容的提问来源于stack exchange,提问作者Ricardo
相关产品推荐
相关产品推荐

