What is the difference between the API calls “v2 /metrics/meetings” and “v2/report/users/{user_id}/meetings”
A meeting that is appearing for a particular user on “v2/report/users/{user_id}/meetings” is not appearing on “v2 /metrics/meetings” on the same time frame.
Thank you for reaching out. The Metrics API endpoint is meant to get near real-time information about a meeting where the information returned is also slightly different information and requires a Business Plan. Conversely, the Report API endpoint is intended to return historical meetings and just requires a Pro Plan.
I hope that helps to answer your question. If you have any further issues please let us know.
Since our GET Meeting Reports endpoint (/reports/user/userId/meetings) returns a participant count in the API response, and allows you to query the past 6 months of data, I’d recommend that endpoint.
The problem with that API on our environment is that it checks every user and we have 12,074 (8,545 licensed users, to be more exact).
I am using “v2/metrics/meetings”, which only give me info on the individual meetings, but I am running into a problem because after a some calls the “next_page_token” token start yielding errors.
Here is a sample of my python code:
def list_meetings(self, date_from, date_to):
"""
List total live or past meetings that occurred during...
...a specified period of time. The month should fall...
...within the last six months.
https://marketplace.zoom.us/docs/api-reference/zoom-api/dashboards/dashboardmeetings
"""
get_url = f"{self.base_url}v2/metrics/meetings"
# Query Parameters
params = {"from": date_from, "to": date_to, "page_size": 250, "type": "past"}
# 1st API call
response = requests.get(url=get_url, params=params, headers=self.headers, proxies=self.proxies)
total_meetings = response.json()["total_records"]
token = response.json()["next_page_token"]
records = response.json()["meetings"]
page_size =response.json()["page_size"]
print(token)
while len(token) > 0:
try:
# Query Parameters
params = {"from": date_from, "to": date_to, "page_size": 250, "type": "past", "next_page_token": token}
# 2nd API call
time.sleep(1)
response = requests.get(url=get_url, params=params, headers=self.headers, proxies=self.proxies)
token = response.json()["next_page_token"]
print(token)
# Add Records to json
records += response.json()["meetings"]
except KeyError as err:
print(err, token)
time.sleep(2)
return records
I am using “v2/metrics/meetings”, which only give me info on the individual meetings, but I am running into a problem because after a some calls the “next_page_token” token start yielding errors.
Can you share an example of the error you’re running into and the corresponding request? I’m happy to take a closer look.
Thank you for the update. I’m not sure how we missed your response but thank you for pinging us to bring it to our attention. Just to clarify, when I’m seeing 'next_page_token' wPbt2HaGMxDpRBfDTocIdLsyI5934z57sT22 in that block of text, that’s coming from the caught KeyError exception here:
except KeyError as err:
print(err, token)
time.sleep(2)
If that’s the case, I would log the requests that are causing that KeyError to make sure that the keys you expect are there. It’s possible that there isn’t another page to those meetings which causes the KeyError when you attempt to fetch the Next Page Token.