The next page token is invalid or expired - Pagination Issues

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”,
“response_headers”: [
“Set-Cookie: zm_aid=”"; 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”
}

Hey @EAyala,

Strange. How long after your first request, are you then using the next_page_token?

Thanks,
Tommy

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.

1 Like

Hey @EAyala,

Happy to hear you got it working! :slight_smile:

Thanks,
Tommy