How to get mail id new

I am using gmail api to get mail id in five minutes. I used general postal new minus, general mail, to get a new mailbox. But the total amount of mail is very large, the process of time is very long. Is there any algorithm for getting the mail id that can process faster?

+3


source to share


1 answer


You can save the timestamp when you receive new messages and use them in your request the next time you send messages.

Example



Let's say you list new posts in Sat Mar 25 2017 21:06:53 GMT+0100 (CET)

. This is the same as the 1490472413

seconds from the epoch. Just use that in the following list with a request after:1490472413

.

GET https://www.googleapis.com/gmail/v1/users/userId/messages?q=after:1490472413

      

+2


source







All Articles