For one of our users (and only one) we frequently get a "404 Not Found" error when calling gmail.users.history.list
. Specifically, it happens when we're paging through the responses (i.e. a pageToken
is given) from gmail.users.history.list
.
The list
method is called when a Gmail push notification indicates the user has a new hisotryId
, at which point we use their previous history ID to get all changes up until this point. The first call to list
always succeeds, but then when using the given pageToken
provided from that initial response, the call fails.
What's weird is when we see these failures in the logs and then try the same call on our own manually later on, they work just fine.
Any ideas? Thanks in advance!
If you're using the same history ID from your initial call, it could be that you're using an invalid history ID. As mentioned in Users.history: list
,
A
historyId
is typically valid for at least a week, but in some rare circumstances may be valid for only a few hours.
Try doing a full synchronization as suggested,
If you receive an HTTP 404 error response, your application should perform a full sync.
You may want to see this related SO post for additional insights.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With