Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何获取当前用户的详细信息,例如电子邮件、姓名等? 我尝试使用About about = service.About.Get().Fetch(); 但它只给了我用户的显示名称。 还有其他功能可以提供更多详细信息吗?
About about = service.About.Get().Fetch();
如果用户允许您使用来自 Google API的权限登录的帐户,您可以找到该电子邮件。
使用 api 的About部分,您可以获得permissionId用户的。
permissionId
listPermissions 命令需要经过身份验证的用户有权访问(例如根文件夹)的 fileId 才能工作
list
获得结果后,您可以使用type=user和过滤对象,如果用户在 Google+ 上共享信息id=PERMISSION_ID_FROM_ABOUT,您可以获得电子邮件 ( )(请参阅有关电子邮件可见性的问题)。emailAddress
type=user
id=PERMISSION_ID_FROM_ABOUT
emailAddress