GMail API: Fastest way to get the oldest email in inbox
I want to get the oldest email in GMail inbox. How can I do that with the minimum number of API calls? One way to do it could be to get the total number of emails from Users:getProfile API and then use User.messages:list API to get the last page using " pageToken " query parameter by using the formula pageToken = totalMessages/50 to get the list of messages from the last page of my inbox and then using the mid of the last message in the list to fetch the oldest email. I am just wondering if there is a better way to do this? I could not figure out other ways to do it from the documentation. Any