I would like to create a group using the API Cloud Identity and the command groups().create().
To do so, I'v used the example provided by Google:
def create_google_group(service, customer_id, group_id, group_display_name, group_description):
group_key = {"id": group_id}
group = {
"parent": "customers/" + customer_id,
"description": group_description,
"displayName": group_display_name,
"groupKey": group_key,
# Set the label to specify creation of a Google Group.
"labels": {
"cloudidentity.googleapis.com/groups.discussion_forum": ""
}
}
try:
request = service.groups().create(body=group)
request.uri += "&initialGroupConfig=WITH_INITIAL_OWNER"
response = request.execute()
print(response)
except Exception as e:
print(e)
But I got an issue:
<HttpError 400 when requesting https://cloudidentity.googleapis.com/v1/groups?alt=json&initialGroupConfig=WITH_INITIAL_OWNER returned "Invalid resource.parent". Details: "[{'@type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'resource.parent', 'description': 'Invalid resource.parent'}]}]">
For the field customer_id, I tried without any success:
- data from https://console.developers.google.com/
- ID clients OAuth 2.0, ID_client: "XXXXXXXXXXXXXXXXX.apps.googleusercontent.com"
- idem but only: "XXXXXXXXXXXXXXXXX"
- project identifier: 'yyyy-yyyy-123456'
- 'me'
- 'my_email@example.com'
- 'my_customer'
Thank you in advance for your support to understand what is expected for the field customer_id!