我正在运行"添加老师"这里的示例代码:https://developers.google.com/classroom/guides/manage-users,使用python 2.7。它今天早些时候工作,但现在我收到了这个错误:
Traceback (most recent call last):
File "test.py", line 93, in <module>
main()
File "test.py", line 79, in main
body=teacher).execute()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/oauth2client-1.4.12-py2.7.egg/oauth2client/util.py", line 137, in positional_wrapper
File "build/bdist.macosx-10.10-x86_64/egg/googleapiclient/http.py", line 729, in execute
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://classroom.googleapis.com/v1/courses/185092455/teachers?alt=json returned "Request contains an invalid argument.">
我将其作为域名超级管理员运行,并请求范围为classroom.courses,classroom.rosters和classroom.profile.emails。当我使用&#34时,我会得到同样的错误;尝试它&#34; course.teachers / create的API参考条目底部的框。
出了什么问题?我怀疑它与权限/ OAuth密钥有关,但我真的不知道。