0

I am trying to retrieve a group by its displayName using the Cloud Identity REST API. As described in Google docs, it should be possible using the search method with a query parameter as follows:

parent == 'customers/{customerId}' && displayName == '{groupName}'

Nonetheless, this request returns a 400 error:

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"
  }
}

I have also tried the following queries for testing purposes to discard error in the query syntax:

Query Response
parent == 'customers/{customerId}' Successful
parent == 'customers/{customerId}' && 'cloudidentity.googleapis.com/groups.discussion_forum' in labels Successful
parent == 'customers/{customerId}' && domain_name == '{domain}' Successful
parent == 'customers/{customerId}' && groupKey == '{groupEmail}' Fails
parent == 'customers/{customerId}' && displayName.contains('{groupName}') Fails
parent == 'customers/{customerId}' && 'cloudidentity.googleapis.com/groups.discussion_forum' in labels && displayName == '{groupName}' Fails

So the problem seems to be in the queries using the parameters displayName or groupKey.

Am I missing something? I thought it might be related to my user's permissions or my Google Workspace/Cloud Identity tier/configuration, but if so I guess the error would be a 403 as stated here in both cases.

Ricardo
  • 129
  • 11

1 Answers1

0

You need to use group_key or display_name instead of groupKey or displayName (ie use Snake Case instead of Camel Case). The docs are wrong in this case.

https://googleapis.github.io/google-api-python-client/docs/dyn/cloudidentity_v1.groups.html