Description
Hello all, we are trying to collect meeting details for a period of time and to browse through the pages results to get all the data we need.
When trying to ready through the pages using next_page_token the API is returning a code 429 for too many API calls despite using a time to make only 1 API call per second. How to get around this issue ?
Error
{“code”:429,“message”:“You have reached the maximum per-minute rate limit for this API. Try again later.”}
Which App Type (OAuth / Chatbot / JWT / Webhook)?
API call on https://api.zoom.us/v2/metrics/meetings using JWT
Which Endpoint/s?
(https://api.zoom.us/v2/metrics/meetings)
How To Reproduce (If applicable)
Steps to reproduce the behavior:
Execute the code below with an active token
$from = "2021-12-05"
$to = "2022-01-05"
$GetMeetingsUsage = Invoke-RestMethod "https://api.zoom.us/v2/metrics/meetings?page_size=300&include_fields=tracking_fields&type=past&from=$from&to=$to" -Method 'GET' -Headers $headers #-TimeoutSec 0.015
$GetMeetingsUsage.total_records
in this example, total records = 14015
and page count = 47
then running the below to browse through all results pages, using a time to make 1 API call per second
do{
$n = $n + 1
$nextpagetoken = $GetMeetingsUsage.next_page_token
Clear-Variable -name GetMeetingsUsage
$GetMeetingsUsage = Invoke-RestMethod "https://api.zoom.us/v2/metrics/meetings?page_size=300&include_fields=tracking_fields&type=past&from=$from&to=$to&next_page_token=$nextpagetoken" -Method 'GET' -Headers $headers
$GrandTotalMeetings = $GrandTotalMeetings + $GetMeetingsUsage.meetings
Start-Sleep 1
Write-Host "page " $n " token : " $GetMeetingsUsage.next_page_token
}
until ($null -eq $nextpagetoken)
throwing the code 429 despite the 1 second timer between each API call.
it seems the script is able to execute 33 API calls before returning error 429
Thanks in advance for your help