google api - Gmail API - Is there a way to list messages in sorted order w.r.t. receive time? -


is there way list gmail mails using google mail apis in sorted order of receive time?

although api returns mails in reverse chronological order. small data set 10 mails, finding discrepancy.

response of mail list api:

 {  "messages": [   {    "id": "15afb61b8d220a19",    "threadid": "15afb61b8d220a19"   },   {    "id": "15afb618f941d73f",    "threadid": "15afb618f941d73f"   },   {    "id": "15afb6174711c7af",    "threadid": "15afb6174711c7af"   },    ...   ...   {    "id": "159bc283f63d5eb7",    "threadid": "159bc283f63d5eb7"   },   {    "id": "159bc283dc97cd87",    "threadid": "159bc283dc97cd87"   },   {    "id": "159bc283d95f097c",    "threadid": "159bc283d95f097c"   }  ],  "resultsizeestimate": 9 } 

first message in response(most recent):

id: 15afb61b8d220a19 date: "thu, 23 mar 2017 19:06:08 +0530"  internaldate: "1490276168000" 

second mail in list:

id: 15afb618f941d73f date: "thu, 23 mar 2017 19:05:58 +0530" internaldate: "1490276158000" 

... ... second last mail in list:

id: 159bc283dc97cd87  date: "fri, 20 jan 2017 05:54:30 -0800"  internaldate: "1484920470000" 

last mail in list(should oldest, not):

id: 159bc283d95f097c date: "fri, 20 jan 2017 05:54:31 -0800" internaldate: "1484920471000" 

i guess it's expected behavior based thread.

...messages.list not return in date asc or date desc. returned randomly far can tell.

you can use search syntax filter email's date.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -