【问题标题】:Unable to invite teachers, students to Classroom via API无法通过 API 邀请教师、学生加入课堂
【发布时间】:2020-11-28 15:46:58
【问题描述】:

Google 课堂 API 有问题

使用 Google Classroom API v1,通过 oAuth2 授权,请求

teachers.create({
 courseId,
 requestBody: {
  userId: email
 }
})

并得到以下错误:

config: {
>      url: 'https://classroom.googleapis.com/v1/courses/237584048292/teachers',
>      method: 'POST',
>      data: {
>        courseId: '237584048292',
>        profile: {},
>        userId: 'dgrz5.0@gmail.com'
>      },
>      body: '{"courseId":"237584048292","profile":{},"userId":"dgrz5.0@gmail.com"}',
>    },
>    data: {
>      error: {
>        code: 403,
>        message: 'The caller does not have permission',
>        errors: [Array],
>        status: 'PERMISSION_DENIED'
>      }
>    },
>    
>    status: 403,
>    statusText: 'Forbidden',
>    request: {
>      responseURL: 'https://classroom.googleapis.com/v1/courses/237584048292/teachers'
>    }
>  }

【问题讨论】:

  • 你从哪里请求它?你在使用特定的库吗?您是否设置了正确的范围?呼叫帐户是管理员吗?我建议也许使用API Explorer 来测试您的请求并确保它严格来说是权限错误。如果您使用的是库,我建议您通过 quickstart guides 之一来确保您拥有经过正确身份验证的应用程序(如果您的请求在资源管理器中有效)。

标签: google-api google-classroom


【解决方案1】:

转到数据库的storage部分。然后在Rules中,允许读取、写入和删除身份验证条件。

【讨论】:

  • 这对 api 有什么用处?数据库与 google api 调用无关。
猜你喜欢
  • 2020-11-11
  • 2016-05-10
  • 2020-08-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-10-16
相关资源
最近更新 更多