我有一个带有表单的 Google 网站。我已将脚本添加到表单的电子表格中,并添加了“表单提交”触发器。我正在尝试创建一个空圆圈。
这是脚本。
function createCircle(e) {
try{
var email = Session.getActiveUser().getEmail();
var sh = SpreadsheetApp.getActiveSheet();
var circle = PlusDomains.newCircle();
circle.displayName = e.values[1];
var userId = 'me';
circle = PlusDomains.Circles.insert(circle, userId);
MailApp.sendEmail(email,'event created' , "Circle name is ");
}catch(e){
var email = Session.getActiveUser().getEmail();
MailApp.sendEmail(email,'event failed' , e.message);
}
}
我已通过转至资源->高级 Google 服务激活了该脚本的 Google+ Domains API。有一行内容是还必须在 Google 开发者控制台中启用这些服务。因此我进入了开发者控制台并激活了 API。
我仍然遇到相同的错误,未配置访问。请使用 Google Developers Console 为您的项目激活 API。
最佳答案
这正是它所说的。修复:
- 转到 Google 开发者控制台 https://console.developers.google.com
- 从列表中选择您的项目
- 从左侧导航栏中选择 API
- 开启您尝试访问的 API。
您可能需要重新生成访问和刷新 token 才能使其正常工作。
关于google-apps-script - "Access Not Configured. Please use Google Developers Console to activate the API for your project.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21014129/