Gmail历史记录列表未提供完整的数据 [英] Gmail History list is not giving complete data

查看:40
本文介绍了Gmail历史记录列表未提供完整的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

我在如下响应中得到historyId

{
    historyId: 12345
}

我尝试添加fields参数没有运气.

I tried adding fields argument with no luck.

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

我做错什么了吗?

推荐答案

响应告诉您,自startHistoryId表示以来,什么都没发生.如果您给自己发送邮件,然后使用相同的startHistoryId再试一次,您将收到一条新消息.

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.

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

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.

这篇关于Gmail历史记录列表未提供完整的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆