我已经编写了一个nodejs脚本来访问Google Cloud Identity API。此nodejs应用使用Oauth2.0客户端访问API,并且具有足够的范围来访问Google Cloud Identity API。一个API请求如下所示:
const url = "https://cloudidentity.googleapis.com/v1beta1/groups/[GROUPID]/memberships/[USERID]";
const res = await oauth2Client.request({ url });
console.log(res.text);
GROUPID的格式为“ abc@mydomain.com”,USERID的格式为“ abcuser@mydomain.com”
以下是我得到的错误:
code: 400,
errors: [
{
message: 'Request contains an invalid argument.',
domain: 'global',
reason: 'badRequest'
}
]