# The next page token is invalid or expired - Pagination Issues

**URL:** <https://devforum.zoom.us/t/the-next-page-token-is-invalid-or-expired-pagination-issues/22383>\
**Category:** API and Webhooks\
**Created:** [June 25, 2020, 6:55pm UTC](https://devforum.zoom.us/t/the-next-page-token-is-invalid-or-expired-pagination-issues/22383 "2020-06-25T18:55:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![EAyala](https://avatars.discourse-cdn.com/v4/letter/e/7bcc69/32.png) [@EAyala](https://devforum.zoom.us/u/EAyala)\
**Post date:** [June 25, 2020, 6:55pm UTC](https://devforum.zoom.us/t/the-next-page-token-is-invalid-or-expired-pagination-issues/22383/1 "2020-06-25T18:55:10Z")

</div>

Hello,  
I am pulling logs using the API. I would rather use Webhooks, but we currently do not support them in our environment. I am using Python to pull User activity and Operational logs. I can successfully pull the first page of logs on my query, but on the next\_page\_token request i get the error "“code”: 300, “message”: “The next page token is invalid or expired.”.

I am looking at the cookie expiration date on the below log, and it says Expires=Thu, 01-Jan-1970 00:00:10 GMT ? Does this mean the expiration time format in my request is invalid? I have tried formating in epoch time as well as regular time, but i continue to get the same results.  
Anyone have any advise?

{  
“endpoint”: “[https://api.zoom.us/v2/report/operationlogs](https://api.zoom.us/v2/report/operationlogs)”,  
“response\_headers”: [  
“Set-Cookie: zm\_aid=”"; [Domain=.zoom.us](http://Domain=.zoom.us); Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly"  
],  
“date\_time”: “2020-06-24 13:10:32”,  
“method”: “GET”,  
“request\_body”: “N/A”,  
“response”: {  
“code”: 300,  
“message”: “The next page token is invalid or expired.”  
},  
“request\_headers”: [  
“accept-encoding: gzip, deflate”,  
“accept: _/_”,  
“authorization: \*\*\*\*\*\*”,  
“connection: close”,  
“content-type: application/json”,  
“user-agent: python-requests/2.23.0”  
],  
“request\_params”: [  
“next\_page\_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”,  
“page\_size: 30”  
],  
“http\_status”: “400”  
}

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [June 26, 2020, 11:22pm UTC](https://devforum.zoom.us/t/the-next-page-token-is-invalid-or-expired-pagination-issues/22383/2 "2020-06-26T23:22:59Z")

</div>

Hey @EAyala,

Strange. How long after your first request, are you then using the next\_page\_token?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![EAyala](https://avatars.discourse-cdn.com/v4/letter/e/7bcc69/32.png) [@EAyala](https://devforum.zoom.us/u/EAyala)\
**Post date:** [July 13, 2020, 4:23pm UTC](https://devforum.zoom.us/t/the-next-page-token-is-invalid-or-expired-pagination-issues/22383/3 "2020-07-13T16:23:36Z")

</div>

Hi Tommy, I resolved this issue. The python “request” module was somehow causing this issue. I went back to using the “http.client” module as the examples on the API reference suggested and this resolved the problem.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [July 15, 2020, 11:48pm UTC](https://devforum.zoom.us/t/the-next-page-token-is-invalid-or-expired-pagination-issues/22383/4 "2020-07-15T23:48:30Z")

</div>

Hey @EAyala,

Happy to hear you got it working! 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 10:43pm UTC](https://devforum.zoom.us/t/the-next-page-token-is-invalid-or-expired-pagination-issues/22383/5 "2020-08-21T22:43:20Z")

</div>

Closed on August 21, 2020, 10:43pm UTC


