Can I use OAUTH2 Service Accounts with Glass Mirror API?

删除回忆录丶 提交于 2019-12-24 16:15:39

问题


I'm trying to use a service account to insert a timeline notiification to my Glass. I've successfully used the technique below to access Google Drive within the same program. The App Engine code below is my attempt to do the same to access the Mirror API. No errors are generated and everything appears successful but I never see the notification on my Glass timeline.

Can I expect service accounts to work with the Mirror API like they do with Drive API?

http = httplib2.Http()
credentials = SignedJwtAssertionCredentials(serviceuseremail, key,
  scope=['https://www.googleapis.com/auth/glass.timeline',
         'https://www.googleapis.com/auth/glass.location'])
http = credentials.authorize(http)
mirror_service = build('mirror', 'v1', http=http)
body = {
  "text": "This item auto-resizes according to the text length",
  "notification": {
  "level": "DEFAULT"
   }
}
mirror_service.timeline().insert(body=body).execute()

来源:https://stackoverflow.com/questions/20314331/can-i-use-oauth2-service-accounts-with-glass-mirror-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!