chrome扩展调用gmail api

时间:2018-03-26 22:37:57

标签: google-chrome-extension gmail-api

我真的很新创建Chrome扩展程序。我正在尝试在我的扩展程序中使用Gmail API从发送的电子邮件文件夹中获取线程ID。我使用过这个教程: https://medium.com/streak-developer-blog/how-to-use-the-gmail-api-in-a-chrome-extension-a272b2405b57 当我使用函数getThreads(查询,标签)时, https://gist.github.com/omarstreak/7908035c91927abfef59

我什么都没得到。另外,当我查看后台控制台时出现此错误: 运行identity.getAuthToken时未经检查的runtime.lastError:OAuth2请求失败:服务响应错误:'客户端ID错误:{0}'

我创建了自己的client_id,并把它放在我的清单中。

 "oauth2": {
"client_id": "27599747390-.................apps.googleusercontent.com",
"scopes": [
  "https://www.googleapis.com/auth/gmail.modify"
]

},

向某人提供一些有关在Chrome扩展程序中使用Gmail API的教程或示例吗?

1 个答案:

答案 0 :(得分:1)

是的,文档中实际上有一个示例。如果您的目的是获取指定的线程,请参阅this method。另外,为了向您提供相应的指导,这里有一个github post可以帮助您更多地了解Chrome扩展基础知识。