【发布时间】:2013-08-13 15:47:14
【问题描述】:
我正在尝试使用 python 和 Python Mirror API Quickstart 代码从我的 Glassware 共享一张卡片(其中的 html)。
creds = StorageByKeyName(Credentials, '#####', 'credentials').get()
plus_service = util.create_service('plus', 'v1', creds)
moment = {"type":"http://schemas.google.com/AddActivity",
"target": {
"id": "target-id-1",
"type":"http://schemas.google.com/AddActivity",
"name": "The Google+ Platform",
"description": "A page that describes just how awesome Google+ is!",
"image": "https://developers.google.com/+/plugins/snippet/examples/thing.png"
}
}
google_request = plus_service.moments().insert(userId='me', collection='vault', body=moment)
result = google_request.execute()
我收到了回复:
HttpError: <HttpError 403 when requesting https://www.googleapis.com/plus/v1/people/me/moments/vault?alt=json returned "Insufficient Permission">
我可以理解这是一个权限问题,但我的问题是,向 Glass 用户询问 G+ 权限的建议 UI 是什么?
此外,通过在请求的权限中添加“https://www.googleapis.com/auth/plus.login”,我得到了: https://www.googleapis.com/plus/v1/people/me/moments/vault?alt=json 返回“未授权”>
提前致谢
【问题讨论】:
-
这里有几件事令人困惑,我不完全确定发生了什么。您能否在请求权限的位置显示代码并准确验证您请求的范围?您是否已验证您实际上已获得授权?您具体使用的是哪个启动项目 - 您提到了 Google+ 和 Glassware,它们都有自己的示例代码集。
标签: python google-plus google-mirror-api