Gmail历史记录列表未提供完整的数据

Mad*_*ddy 2 gmail gmail-api

我正在尝试从gmail API watch()提供的historyId获取历史记录

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

我得到historyId如下响应

{
    historyId: 12345
}
Run Code Online (Sandbox Code Playgroud)

我尝试添加fields论点没有运气。

https://www.googleapis.com/gmail/v1/users/me/history?startHistoryId=12345&fields=historyId的请求,history(id%2Cmessages)也失败

我做错什么了吗?

Tho*_*lle 5

响应告诉您,自您的startHistoryId代表以来,什么都没发生。如果您给自己发送邮件并再次尝试发送startHistoryId邮件,结果将收到一条新消息。

如果要从中获取historyId watch(),则是另一个问题。在historyId你的推送通知得到只是指出目前historyId您正在观看的标签。想一想。Google应该如何知道您上次同步的时间?收到推送通知时,您需要使用historyId自上次请求以来存储的信息。