Gmail History list is not giving complete data

落爺英雄遲暮 提交于 2019-12-11 03:36:39

问题


I am trying to get history from historyId which gmail api watch() gives

https://developers.google.com/gmail/api/v1/reference/users/history/list

I am getting historyId in the response like below

{
    historyId: 12345
}

I tried adding fields argument with no luck.

request to https://www.googleapis.com/gmail/v1/users/me/history?startHistoryId=12345&fields=historyId,history(id%2Cmessages) is also failing

Am I doing anything wrong?


回答1:


The response tells you that nothing has happened since the time your startHistoryId represents. If you send yourself a mail and try again with the same startHistoryId, you will get a new message as result.

If you are getting the historyId from watch(), it is another issue. The historyId you get in the push notification simply states the current historyId of the label you are watching. Think about it. How should Google know when you last synced? When you get a push notification, you need to use the historyId you stored since last time in your request.



来源:https://stackoverflow.com/questions/32248048/gmail-history-list-is-not-giving-complete-data

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