Need some clarity on gmail apis

Viewed 34

Q1. What is the Order in which the message list returns the messages. i.e message.list api? Whether it is based on the message timestamp or any other field.

Q2. If I want to sync a very large mailbox and I fire a message.list api, then I get a pageToken for pagination, so how long is the pageToken valid? For eg if I get a page token X and I fire the api to fetch the next page after 6-7 hours will I still get the expected response.

1 Answers

Q1. What is the Order in which the message list returns the messages. i.e message.list api? Whether it is based on the message timestamp or any other field.

There is no guaranteed order, the order is what ever the server returns it in. You should sort things locally if you need them sorted.

Q2. If I want to sync a very large mailbox and I fire a message.list api, then I get a pageToken for pagination, so how long is the pageToken valid? For eg if I get a page token X and I fire the api to fetch the next page after 6-7 hours will I still get the expected response.

I dont think there is a strict time but i have had issues in the past with them expiring in under five minutes. No you should not wait hours before fetching it the nextpage token should be used as soon as possible.

I cant help with your history questions. Which is one of the reasons why questions should only include a single question and not a group as you have done here.

Related