How long are nextPageTokens remembered for Gmail and Calendar APIs?

大兔子大兔子 提交于 2021-02-20 19:02:15

问题


The Gmail and Calendar APIs return a nextPageToken value in the response from the users.messages.list and events.list endpoints when pagination is required. If the value of the nextPageToken is provided in the next request to these endpoints, the next page of results is returned.

My question: How long are these nextPageTokens persisted behind the Gmail and Calendar APIs?

Context: I am building an abstraction on top of both the Gmail and Calendar APIs to return a list of Activities, and this endpoint has its own pagination. My pagination works by storing the nextPageToken values returned by the Gmail and Calendar APIs in a cache and returning a UUID the client can specify in the next request to pop and use those Gmail and Calendar nextPageTokens (just like the Google APIs themselves).

Goal: Configure my pagination cache TTL to, at most, be equal to the TTL (if there is one) of the Google APIs so that it always works as intended.


回答1:


nextPageToken does not expire. It is just like an Index position. However if new items are added/deleted, you might not see the same result as you expect.




回答2:


The token expires after 1 Hour. I came to know about that while working with Google Directory API. Link to the problem I faced.



来源:https://stackoverflow.com/questions/39476276/how-long-are-nextpagetokens-remembered-for-gmail-and-calendar-apis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!