[英]get first and last name from e-mail address in Enterprise G-Suite
I am trying to find a user's name from their e-mail address. 我正在尝试从他们的电子邮件地址中找到用户的名字。 I thought I could use People.People.get
as mentioned here but that requires knowing the user's account ID. 我以为我可以使用People.People.get
提到这里 ,但需要知道用户的帐户ID。
How can I get information about the user if I only know their e-mail? 如果我仅知道他们的电子邮件,如何获得有关该用户的信息?
And I don't think I can use the Directory API cause I don't have admin access. 而且我认为我无法使用Directory API,因为我没有管理员权限。
You can use Admin Directory API to get user's details. 您可以使用Admin Directory API来获取用户的详细信息。 While making the URL call, you need to specify a parameter in the request body which is (viewType:"domain_public"), so you will get the basic details of the user in your domain without having admin rights. 进行URL调用时,您需要在请求正文中指定一个参数(viewType:“ domain_public”),这样您将获得域中用户的基本详细信息,而无需管理员权限。
Reference Link : https://developers.google.com/admin-sdk/directory/v1/reference/users/get 参考链接: https : //developers.google.com/admin-sdk/directory/v1/reference/users/get
I don't think you can do it without Admin Rights, on the link you mentioned you need the AccountId which can only be retrieved by having Admin Rights and Access to the Directory API ( https://developers.google.com/admin-sdk/directory/v1/reference/users/get ) which you mentioned tyou don't have access to. 我认为如果没有管理员权限,您无法做到这一点,在您提到的链接上,您需要AccountId,该帐户只能通过具有管理员权限和对Directory API的访问权限( https://developers.google.com/admin- sdk / directory / v1 / reference / users / get ),其中提到您无权访问。
You could ask to your Administrator to get an Admin Role https://support.google.com/a/answer/172176?hl=en to use the Admin SDK for complete your task, it will be easier for you. 您可以要求管理员获得管理员角色https://support.google.com/a/answer/172176?hl=zh_CN,以使用Admin SDK来完成您的任务,这对您来说会更加容易。 The other way I don't know how the contact sharing is setup in your organization because you should be able to check the information of the contact when sending an email or adding it to your contact list. 另一种方式是,我不知道您的组织中如何设置联系人共享,因为在发送电子邮件或将其添加到联系人列表时,您应该能够查看联系人信息。
I hope this information can be of help. 希望这些信息对您有所帮助。 Greetings. 问候。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.