问题
I'm developing a php application using Google Classroom.
I have a problem to create a topic for a course: I can view the list of topics, but I can't create one.
This is the error:
Google_Service_Exception Object
(
[errors:protected] => Array
(
[0] => Array
(
[message] => The caller does not have permission
[domain] => global
[reason] => forbidden
)
)
[message:protected] => {
"error": {
"code": 403,
"message": "The caller does not have permission",
"errors": [
{
"message": "The caller does not have permission",
"domain": "global",
"reason": "forbidden"
}
],
"status": "PERMISSION_DENIED"
}
}
These are my scopes:
$client->setScopes(array(Google_Service_Classroom::CLASSROOM_COURSES,
Google_Service_Classroom::CLASSROOM_ROSTERS,
Google_Service_Classroom::CLASSROOM_COURSEWORK_ME,
Google_Service_Classroom::CLASSROOM_COURSEWORK_STUDENTS,
Google_Service_Classroom::CLASSROOM_TOPICS,
Google_Service_Classroom::CLASSROOM_PROFILE_EMAILS,
));
And I have permission:
See Permissions
The user is an administrator, I can create courses but I do not understand why I cannot create topics
回答1:
Topics can only be created by teachers, not by admins
As a workaround, ask to be added as a teacher to the course - this will give you the permissions to create topics.
来源:https://stackoverflow.com/questions/60870551/google-classroom-create-topic-returning-403-authentication-error