问题
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