未找到邀请ID

时间:2015-08-06 03:39:08

标签: google-classroom

我知道这是两排的,但它们是不同的问题,所以我认为最好将它们分开。我在代表学生接受邀请时遇到了问题。我是域内的超级管理员,它通过API资源管理器工作,但不是通过Google Apps脚本的课堂高级服务。在你问之前,是的,我确实在Advanced Services菜单和Developer's Console中都启用了Classroom。

这是代码块:

function invitations() {
  var classList = Classroom.Courses.list().courses;
  for (i in classList) {
    var classId = classList[i].id;
    var teacher = Classroom.Courses.Teachers.get(classId, classList[i].ownerId).profile.name.fullName;
    if (teacher == 'FULL_NAME_GOES_HERE') { // I had entered my full name here as a string. If testing, you can replace with your own
      var title = Classroom.Courses.get(classId).name;
      Logger.log('Teacher: %s, Title: %ss',teacher,title);
      var list = Classroom.Invitations.list({'courseId':classId}).invitations;
      if (list) {
        Logger.log('list');
        for (k in list) {
          var invitation = list[k];
          var student = invitation.userId;
          var id = invitation.id;
          var response = Classroom.Invitations.accept({id:id});
          Logger.log('ID: %s',id);
        }
      }
    }
  }
}

传递给Classroom.Invitations.accept的id返回错误“找不到请求的实体”。但是当我在API资源管理器中输入相同的ID时,它会返回200 - OK。这是授权范围的问题吗?我有权管理课堂名单,我相信这属于名单。

0 个答案:

没有答案