【发布时间】:2017-06-25 05:03:48
【问题描述】:
Gmail API history.list 正在返回 messageId,当 message.get 被调用时返回 404。
我用“INBOX”标签和“history/messagesAdded”字段调用history.list。然后我调用 message.get 并返回每个 messageId。其中一些返回有效消息,另一些返回以下异常:
Google_Service_Exception
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"code": 404,
"message": "Not Found"
}
}
这是什么原因造成的?似乎我们只是检索了 messageId,没有足够的时间将它们现在永久删除。
【问题讨论】:
-
如果您还获得了
history/messagesDeleted和history/labelsRemoved字段,您可能会看到这些消息已被删除。 -
它们会同时出现在
history/messagesAdded和history/messagesDeleted中进行同一个调用吗? -
是的。您将获得从
historyId到现在为止的历史记录,因此如果该邮件已添加到收件箱并从historyId删除,则相同的messageId将同时出现在history/messagesAdded和history/messagesDeleted中。
标签: gmail-api