# Next\_page\_token intermittently invalid

**URL:** <https://devforum.zoom.us/t/next-page-token-intermittently-invalid/64895>\
**Category:** API and Webhooks\
**Created:** [February 25, 2022, 5:11pm UTC](https://devforum.zoom.us/t/next-page-token-intermittently-invalid/64895 "2022-02-25T17:11:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrickgi](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/patrickgi/32/35452_2.png) [@patrickgi](https://devforum.zoom.us/u/patrickgi)\
**Post date:** [February 25, 2022, 5:11pm UTC](https://devforum.zoom.us/t/next-page-token-intermittently-invalid/64895/1 "2022-02-25T17:11:37Z")

</div>

**Description**  
I have an app that calls `metrics/meetings`, for the current month of meeting data. So, by the end of the month, it can get up to about 300-350 calls. Not a little, but not a ton. I paginate through these with a 2500ms time delay in between, to avoid 429 errors. What is happening, is that I am getting intermittent 400 error requests…it seems like the next\_page token provided is sometimes invalid.

**Error**  
Error: Request failed with status code 400

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
JWT, no issues with authentication, as I have several tools using the same auth methods.

**Which Endpoint/s?**  
/metrics/meetings

**How To Reproduce (If applicable)**  
Steps to reproduce the behavior:

1. let getPage = async (next) =\> {  
return new Promise((resolve, reject) =\> {  
axiosRetry(axios, { retryDelay: axiosRetry.exponentialDelay});  
axios.request(`${zoomBaseUrl}/metrics/meetings`, {  
headers: {  
Authorization: zoomAuth  
},  
params: {  
type: ‘past’,  
from: firstDayThisMonth, //shorten scope for testing  
to: yesterday,  
page\_size: 300,  
next\_page\_token: next || null  
}  
})  
\<…then, later down in the code…\>  
if (page.next\_page\_token) {  
await timeoutPromise(2500);  
firstTime = false;  
console.log(`next page ${page.next_page_token}`);  
return await pageData(page.next\_page\_token);

2. I had a screenshot, but it won’t let me embed media items in the post.

**Additional context**  
This is an intermittent issue. Sometimes I re-run the same script, and it works, right after having not worked, with 0 intervention from me. When the script lives on my computer, it passes through the failed call, and still works 100% of the time (albeit with that page of data missing)…but when it is in a CI/CD pipeline, the pipeline will fail without 100% successful API calls. Adding in a retry mechanism has helped, and I have 3 successful consecutive calls, but not consistent yet. Wondering why a page might register as invalid. Timeout shouldn’t be a concern here.

---

<div class="post-metadata">

**Author:** ![patrickgi](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/patrickgi/32/35452_2.png) [@patrickgi](https://devforum.zoom.us/u/patrickgi)\
**Post date:** [March 8, 2022, 6:14pm UTC](https://devforum.zoom.us/t/next-page-token-intermittently-invalid/64895/2 "2022-03-08T18:14:07Z")

</div>

I added a lib in node called axiosretry that is solving this for now. I don’t know why the next\_page\_token registers invalid from time to time, and I can see from [another ticket](https://devforum.zoom.us/t/dashboard-meetings-api-next-page-token-in-invalid-or-expired/54179) that this has happened elsewhere.

Regardless, its no longer an issue for me.

Thanks,

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [April 6, 2022, 6:31pm UTC](https://devforum.zoom.us/t/next-page-token-intermittently-invalid/64895/3 "2022-04-06T18:31:46Z")

</div>

Hi, @patrickgi,

Thank you for calling attention to the behavior you are seeing. I am happy to share your details with our Engineering team to take a closer look. Would you be able to submit a ticket with our support with your account details along with the API request/response? From there we can look at our logs and see if the Engineering team needs to troubleshoot. [Submit A Request For Support Here](https://support.zoom.us/hc/en-us/requests/new?ticket_form_id=360000996591)

Best,  
Donte

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [May 7, 2022, 4:32am UTC](https://devforum.zoom.us/t/next-page-token-intermittently-invalid/64895/4 "2022-05-07T04:32:20Z")

</div>

Closed on May 7, 2022, 4:32am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
