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

**URL:** <https://devforum.zoom.us/t/error-300-the-next-page-token-is-invalid-or-expired/74076>\
**Category:** Archiving\
**Created:** [August 11, 2022, 4:29pm UTC](https://devforum.zoom.us/t/error-300-the-next-page-token-is-invalid-or-expired/74076 "2022-08-11T16:29:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![DarylH](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/darylh/32/40410_2.png) [@DarylH](https://devforum.zoom.us/u/DarylH)\
**Post date:** [August 11, 2022, 4:29pm UTC](https://devforum.zoom.us/t/error-300-the-next-page-token-is-invalid-or-expired/74076/1 "2022-08-11T16:29:46Z")

</div>

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.

```auto
   //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 :

```auto
            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.

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [August 12, 2022, 1:41am UTC](https://devforum.zoom.us/t/error-300-the-next-page-token-is-invalid-or-expired/74076/2 "2022-08-12T01:41:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DarylH](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/darylh/32/40410_2.png) [@DarylH](https://devforum.zoom.us/u/DarylH)\
**Post date:** [August 12, 2022, 1:26pm UTC](https://devforum.zoom.us/t/error-300-the-next-page-token-is-invalid-or-expired/74076/3 "2022-08-12T13:26:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [August 12, 2022, 6:37pm UTC](https://devforum.zoom.us/t/error-300-the-next-page-token-is-invalid-or-expired/74076/4 "2022-08-12T18:37:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DarylH](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/darylh/32/40410_2.png) [@DarylH](https://devforum.zoom.us/u/DarylH)\
**Post date:** [August 16, 2022, 6:16pm UTC](https://devforum.zoom.us/t/error-300-the-next-page-token-is-invalid-or-expired/74076/6 "2022-08-16T18:16:58Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [August 16, 2022, 9:15pm UTC](https://devforum.zoom.us/t/error-300-the-next-page-token-is-invalid-or-expired/74076/7 "2022-08-16T21:15:55Z")

</div>

Thanks for sharing this with the community! @DarylH

---

<div class="post-metadata">

**Author:** ![DarylH](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/darylh/32/40410_2.png) [@DarylH](https://devforum.zoom.us/u/DarylH)\
**Post date:** [August 17, 2022, 10:09pm UTC](https://devforum.zoom.us/t/error-300-the-next-page-token-is-invalid-or-expired/74076/8 "2022-08-17T22:09:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [August 23, 2022, 4:39pm UTC](https://devforum.zoom.us/t/error-300-the-next-page-token-is-invalid-or-expired/74076/9 "2022-08-23T16:39:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [August 23, 2022, 8:45pm UTC](https://devforum.zoom.us/t/error-300-the-next-page-token-is-invalid-or-expired/74076/10 "2022-08-23T20:45:59Z")

</div>

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!
