According to the Gmail API reference, Users.messages: list "[lists] the messages in the user's mailbox". In my observation, the messages are returned in descending order by data. Is this a correct assumption?
Basically I want to be able to process a user's inbox after a couple of days without reprocessing messages I have already processed. I would do that by stopping once I stumble upon an email I have seen before. Using the history doesn't work reliable, since it is documented that history might expire within a few hours, requiring a full new sync.
The message list is the group of emails in the center of the Gmail page. You can also show or hide a Label from the message list by clicking "show" or "hide". A hidden label in the message list makes your Inbox neater, while a label that is shown in the message list makes it easier to identify the specific email.
Yes, you are correct. Messages are returned in descending order, with the newest one first.
You could save the internalDate
of the newest message and list new messages with that value in the query a few days later.
Example
internalDate = 1490213949000 // Wed Mar 22 2017 21:19:09 GMT+0100 (CET)
q=after:1490213949 // 'after' takes seconds since the epoch. internalDate/1000
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