0

I have written a nodejs script to access Google Cloud Identity API. This nodejs app uses Oauth2.0 client to access the API and it has enough scopes to access the Google Cloud Identity API. An API request looks like as follows :

const url = "https://cloudidentity.googleapis.com/v1beta1/groups/[GROUPID]/memberships/[USERID]";
const res = await oauth2Client.request({ url });
console.log(res.text);

format of GROUPID is "abc@mydomain.com" , format of USERID is "abcuser@mydomain.com"

Following is the error I'm getting:

code: 400,
   errors: [
     {
       message: 'Request contains an invalid argument.',
       domain: 'global',
       reason: 'badRequest'
     }
   ]
Nipu
  • 653
  • 1
  • 8
  • 15
  • 2
    Your endpoint must use the unique_id for the group and the member. Do a list operation to see the values. https://cloud.google.com/identity/docs/reference/rest/v1/groups/list – John Hanley Jul 09 '20 at 21:44
  • 1
    @JohnHanley groups.list api require "Customer ID" as a parameter. As google group is created from my organization (not me) i don't have customer id – Nipu Jul 10 '20 at 16:20
  • Look at this API to get Google Groups information: https://developers.google.com/admin-sdk/directory/v1/guides/manage-groups#get_all_domain_groups – John Hanley Jul 10 '20 at 20:12

0 Answers0