How to get mail id new
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 to share