【问题标题】:returned "Insufficient Permission"返回“权限不足”
【发布时间】:2013-09-10 02:02:00
【问题描述】:
class DirectoryV1Handler(webapp2.RequestHandler):
  @decorator.oauth_required
  def get(self):
    https = httplib2.Http()
    https = decorator.credentials.authorize(https)
    #service = build('directory', 'v1', http=https)
    service = build('admin', 'directory_v1', http=https, developerKey="YOUR-API-CONSOLE-KEY")
    #json.dumps(service)
    logging.info(service.userphoto().get(userKey='userKey'))
    user = service.userphoto().get(userKey='userKey').execute()
    logging.info(user)

运行上述程序时出现以下错误,请提供帮助: HttpError 403 when requesting https://www.googleapis.com/admin/directory/v1/users/{userKey}?alt=json&key="YOUR-API-CONSOLE-KEY" returned "Insufficient Permission"

【问题讨论】:

  • 好吧 403 说明了一切,您没有该资源的权限。

标签: python google-app-engine python-2.7 google-admin-sdk


【解决方案1】:

您需要将 YOUR-API-CONSOLE-KEY 替换为 API 控制台中的密钥

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-02
    • 2016-01-09
    • 2014-10-24
    • 2015-03-04
    • 2017-06-21
    • 2018-12-07
    相关资源
    最近更新 更多