Error: 300 - The next page token is invalid or expired

I’ve found many posts like this and most of them are just closed after 30 days with no response from the Original Poster.

I’m getting the above error when using the following code.

   //Call to ge the JSON file that is a list of all the meetings.
            RestClient client = new RestClient("https://api.zoom.us/v2/archive_files?from=" + dateFrom + "T00:00:01Z&to=" + dateTo + "T23:59:59Z&page_size=300") {
                Proxy = proxyStuff
            };  //get Archive Viles

            RestRequest request = new RestRequest();
            request.AddHeader("content-type", "application/json");
            request.AddHeader("authorization", "Bearer " + securityToken);
            IRestResponse response = client.Execute(request);

after getting that I am then extracting the token then running the following :

            RestClient client = new RestClient("https://api.zoom.us/v2/archive_files?next_page_token=" + nextToken ) {
                Proxy = proxyStuff
            };  
            RestRequest request = new RestRequest();
            request.AddHeader("content-type", "application/json");
            request.AddHeader("authorization", "Bearer " + securityToken);
            IRestResponse response = client.Execute(request);

These calls are happening within10 seconds of eachother and i’m getting an invalid or expired error.
Through Debugging I am able to see that I am passing the exact string from the first call.

I’ve also tried passing in the access_token as a URL parameter instead of as an authorization header, that too didnt work.

Hi @DarylH

Thanks for reaching out to the Zoom Developer Forum, I am happy to help here!
Could you please share with me via Private message the email associated with the account that you are making this request so I can look into this and debug this issue further?
Best, ,
Elisa

I’m sorry, but i legitimately cant find where to send private messages… Guess I’m too new to this devforum

Do not worry! I will send you one and you can reply there! @DarylH

replying here with the solution that ZOOM provided, so that if anyone else comes across this issue, its something to check.

I just heard back from our Engineering team and they gave me some insights on your issue.

It looks like you got this error because you picked a “to” time in the future

In this case, Zoom API returns a “to” time that is the current time that the customer must update for their request that follows using the next_page_token or they will get the invalid next page token error.

Please, make sure to update this field(“to”) when making the request using the next_token_page parameter.

Copying the exact call and appending &next_page_token=XXXXXXXXXXXXXXXXXXX did seem to do the trick if I was doing the call for ‘yesterday’.

The initial issue was that the “to” date in my initial call was for the entire day (T23:59:59Z) and this call works fine, But appears that the 'next token" doesnt like future dates.

So if you’re using a timestamp for the “to” that is in the future, it also breaks this. Even though the initial call will work with a ‘future’ time. the “to” date.

I mistakenly just assumed that that since the token was unique I didn’t need to repass everything as only one would exists in the system.

thanks for your help!

1 Like

Thanks for sharing this with the community! @DarylH

can I ask what the syntax could look like if I only wanted thing for TODAY, i just tried putting the current time and date in for the “to” and it still doesnt work.

Hey @DarylH
I am sorry I did not reply earlier, I did not see your response.
Allow me some time to troubleshoot this and will come back to you as soon as possible.
Best,
Elisa

Hi @DarylH
Have you tried passing the value for “to” that you are getting from the response body?
Or could you please try passing the exact value for to with hours, min, and secs at the moment you send the request? instead of setting up the “to” value to the end of the day?

Let me know if this helps!