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:
-
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); -
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.