在Google Apps脚本中获取用户ID

比诺

是否可以使用会话服务或类似服务在Google Apps脚本中获取用户ID(而不是电子邮件地址)

我没有在GAS中看到任何对此的引用,但是在GAE中,我能够从Users API获取用户ID 用户ID是即使用户更改其电子邮件地址也可以唯一标识用户的标识符。

我希望在GAS中使用相同的内容。

附加仓库

是否可以使用会话服务或类似服务在Google Apps脚本中获取用户ID(而不是电子邮件地址)?

是的,有可能。您可以利用AdminSDK Directory API来获取用户ID,该API可通过Admin Directory Advanced Google Service从App Script访问

用法示例:

// NOTE: Admin Directory Advanced Service must be enabled first.

// Get first page of user ids for users in domain
var userIds = AdminDirectory.Users.list({"domain":"www.example.com"}).users.map(function(user) { 
    return user.id; 
});

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

使用 Google Apps 脚本从 Admin Directory API 按部门获取用户

从Google Play服务获取用户ID?

无法在Google Apps脚本中获取Sheet ID

在Google Apps脚本中获取按下按钮的ID或标签

如何通过Google Plus中的用户ID获取用户图片?

如何在Google Apps脚本自定义功能中获取“活动用户”的用户属性

从Google Play Games API获取用户ID?

使用Google Play服务在Xamarin中获取用户位置

使用PHP中的Google API OAuth获取用户信息

如何在Google翻译Api中获取用户词典

AuthorizationError:无法在Google Colab中获取用户凭据

从Android中的Google Plus获取用户名

如何在Google Apps脚本中获取发布到网络电子表格的ID

在Google Apps脚本中获取新创建的文件夹的ID

如何从Google Apps脚本中的urlfetch获取Google搜索结果

如何在Google Apps域中使用弱密码获取用户列表

如何在Google脚本上以字符串形式获取用户输入

获取用户列表的Google网上论坛

Google Places API,获取用户地址

Apps脚本以获取用户签名

在Google Apps脚本中获取文件夹名称

在Google Apps脚本中获取幻灯片标题

使用Google Apps脚本从图表中获取所有系列

如何获取Google Apps脚本中特定值的检查列?

获取由Google Apps脚本中的if()语句过滤的总行数

无法使用 Drive API 在 Google Apps 脚本中获取文件

通过Google Apps脚本中的https调用获取状态文本

如何在Google Apps脚本中获取Blob对象的大小?

从Express(passport.js)的Google身份验证获取用户ID