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'
}
]