许多Directory API调用需要客户参数,该参数被称为“Google Apps帐户的不可变标识(字符串)”。如何找到我的Google Apps帐户的不可变ID?
例如GET https://www.googleapis.com/admin/directory/v1/customer/客户 /域
我不知道如何找到/生成该为我的谷歌Apps帐户。我是管理员。
有人可以指点我正确的方向吗?
许多Directory API调用需要客户参数,该参数被称为“Google Apps帐户的不可变标识(字符串)”。如何找到我的Google Apps帐户的不可变ID?
例如GET https://www.googleapis.com/admin/directory/v1/customer/客户 /域
我不知道如何找到/生成该为我的谷歌Apps帐户。我是管理员。
有人可以指点我正确的方向吗?
有同样的问题,所以我不得不联系他们的聊天支持。
官方回答是:
没有任何Web界面可以查找此信息 - 正如我在“组织管理面板”中所期望的那样。获取这些信息的唯一方法是从代码中获取。
你必须写额外的代码来请求有关的任何现有用户信息:
(Link to API Docs - GET:https://www.googleapis.com/admin/directory/v1/users)
并在响应中,你可以找到现场customerId
这是在公司的每个用户相同的跨所有领域。
那就是发现自己的组织customerId
的唯一途径...
不是用户友好的,所以我会提交“功能要求”,现在谷歌。
该方法需要客户ID,这让我感到困惑。后来我发现可以使用'my_customer'来代替客户ID,事实上客户ID也包含在响应中。 –
我能找到客户ID如下
你会看到网址是这样的:
https://accounts.google.com/o/saml2/idp?idpid=Cxxxxxxxx
这Cxxxxxxxx是你的客户Id
找不到它;也许他们改变了链接结构? –
我仍然可以看到相同的网址和客户ID,现在就试试这个。 – rsmoorthy
我发现的最简单的方法是使用APIs Explorer at the bottom of the documentation作为客户:在Directory API(Admin SDK)上获取方法。在表单上为customerKey输入'my_customer',然后点击'授权和执行'按钮。
响应将包括CustomerId(例如Cxxxxxxxx)作为“id”。该entire response会是这个样子:
{
"kind": "admin#directory#customer",
"id": string,
"etag": etag,
"customerDomain": string,
"alternateEmail": string,
"postalAddress": {
"organizationName": string,
"countryCode": string,
},
"language": string,
"customerCreationTime": datetime
}
可以调用方法Users.get用自己的帐户,你可以找到在客户的响应结束。 – Gerardo