英文:
Gmail API Pub/Sub Push not stopping
问题
我正在使用Gmail API进行开发,一切都正常,我可以授权用户帐户将电子邮件推送到我的端点并发送下一个历史记录ID。
问题出在删除帐户上。我已经从Google Cloud Platform中删除了该帐户,我还从Gmail的帐户/设置/已连接的应用和站点中删除了该应用,但是仍然有一些东西在向我的Web服务器推送更新。我可以看到请求进来,但未被授权,但它仍然在继续推送。我该如何在Gmail中停止它?
我在服务器上收到以下信息:
2016/09/26 10:34:30 [D] [server.go:2202] | 503 | 41.984725ms| match| POST /push r:/push
d: {user@name.com 2776948}
current user: user@name.com
last history id: 2776700
doing error: Get https://www.googleapis.com/gmail/v1/users/me/history?alt=json&startHistoryId=2776700: oauth2: cannot fetch token: 401 Unauthorized
Response: {
"error" : "deleted_client",
"error_description" : "The OAuth client was deleted."
}
所以客户端已被撤销,但推送仍在继续。非常奇怪...
英文:
I am developing with the Gmail API, and everything is working, I can authorize a user account to Push emails to my endpoint and send the next History ID.
The issue is with removing the account. I have deleted the account from the Google Cloud Platform, I have removed the app from Account/Settings/Connected Apps and Sites from within Gmail, however something is STILL pushing updates to my web server. I can see the request coming in and not being authorized, but it never the less is still pushing. How do I stop it in Gmail???
I receive this on my server:
2016/09/26 10:34:30 [D] [server.go:2202] | 503 | 41.984725ms| match| POST /push r:/push
d: {user@name.com 2776948}
current user: user@name.com
last history id: 2776700
doing error: Get https://www.googleapis.com/gmail/v1/users/me/history?alt=json&startHistoryId=2776700: oauth2: cannot fetch token: 401 Unauthorized
Response: {
"error" : "deleted_client",
"error_description" : "The OAuth client was deleted."
}
So the client is revoked, but the push still occurs. Verry weird...
答案1
得分: 1
你还需要发送一个请求来停止监视用户的邮箱:
POST https://www.googleapis.com/gmail/v1/users/me/stop?access_token={access_token}
英文:
You also have to send a request to stop watching the user's mailbox:
POST https://www.googleapis.com/gmail/v1/users/me/stop?access_token={access_token}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论