我不能让这个方法适用于 Apps 脚本课堂 API
i Cant make this method works on Apps script classroom API
var ClassroomID=305126825015
var TeacherslistID=[mike@gtrainerdemo.com, lola@gtrainerdemo.com, jeronimo@gtrainerdemo.com, antonio@gtrainerdemo.dimensiongrafica.com, andrew@gtrainerdemo.com];
for (K = 0; K < TeacherslistID.length; K++)
{
Classroom.Courses.Teachers.remove({"userId":TeacherslistID[K]},ClassroomID);
}
错误:GoogleJsonResponseException:API 调用 classroom.courses.teachers.delete 失败,错误:未找到请求的实体。
我确认我用来创建课程的老师的 ID 在其他方法上效果很好,如 classroom.courses.teachers.create,所以不知道我在这里是否犯了错误。我可以错过什么吗?
要在 Apps 脚本中使用课堂 API 删除教师,您需要使用 Classroom.Courses.Teachers.remove(courseId: string, userId: string)
You can check the arguments when you type Classroom.Courses.Teachers.remove(
and wait for the support tab to be displayed.
你的代码应该是这样的:
var TeacherslistID=['mike@gtrainerdemo.com', 'lola@gtrainerdemo.com', 'jeronimo@gtrainerdemo.com', 'antonio@gtrainerdemo.dimensiongrafica.com', 'andrew@gtrainerdemo.com'];
for (K = 0; K < TeacherslistID.length; K++)
{
Classroom.Courses.Teachers.remove(ClassroomID, TeacherslistID[K]);
}
var ClassroomID=305126825015
var TeacherslistID=[mike@gtrainerdemo.com, lola@gtrainerdemo.com, jeronimo@gtrainerdemo.com, antonio@gtrainerdemo.dimensiongrafica.com, andrew@gtrainerdemo.com];
for (K = 0; K < TeacherslistID.length; K++)
{
Classroom.Courses.Teachers.remove({"userId":TeacherslistID[K]},ClassroomID);
}
错误:GoogleJsonResponseException:API 调用 classroom.courses.teachers.delete 失败,错误:未找到请求的实体。
我确认我用来创建课程的老师的 ID 在其他方法上效果很好,如 classroom.courses.teachers.create,所以不知道我在这里是否犯了错误。我可以错过什么吗?
要在 Apps 脚本中使用课堂 API 删除教师,您需要使用 Classroom.Courses.Teachers.remove(courseId: string, userId: string)
You can check the arguments when you type
Classroom.Courses.Teachers.remove(
and wait for the support tab to be displayed.
你的代码应该是这样的:
var TeacherslistID=['mike@gtrainerdemo.com', 'lola@gtrainerdemo.com', 'jeronimo@gtrainerdemo.com', 'antonio@gtrainerdemo.dimensiongrafica.com', 'andrew@gtrainerdemo.com'];
for (K = 0; K < TeacherslistID.length; K++)
{
Classroom.Courses.Teachers.remove(ClassroomID, TeacherslistID[K]);
}