我正在尝试查看是否已存在具有name@domain.com
的电子邮件帐户,但我一直收到以下错误:
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/admin/directory/v1/users/name%domain.comL?alt=json returned "Not Authorized to access this resource/api">
虽然我使用相同的凭据成功地使用了代码中的users().insert()方法。 我尝试了"Try it"网页来获得这个确切的请求,并注意到两件事。在
https://www.googleapis.com/admin/directory/v1/users/name%40domain.com?key={YOUR_API_KEY}
而不是https://www.googleapis.com/admin/directory/v1/users/name%domain.comL?alt=json
。我猜这只是在URL中使用OAuth生成的密钥。在我用Python编写,并使用googleapi for Pythonhttps://github.com/google/google-api-python-client/tree/master/googleapiclient。在
我使用的范围:
^{pr2}$
目前没有回答
相关问题 更多 >
编程相关推荐