Search code examples
gmail-api

Problems with sorting emails


I am wresting to sort email messages which I got using this api https://developers.google.com/gmail/api/v1/reference/users/messages/list

Does anybody know how gmail api send this messages? Do they send messages in order? Thanks


Solution

  • Go to Users.messages.list and Execute the Try-it. You will notice that the threadIds of messages appear in descending order with the newest one appearing on top. Also confirmed in this SO post.