-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Past Meeting Attendees does not handle pagination #166
Comments
Once I implement a fix, I'll try to upload a PR. I already had an implementation similar to this in my own code, came looking to see if a module had already dealt with it.. Either way, shorter code, and better error handling that my quick attempt. |
(I'm on hold on working on a fix, since this list doesn't provide the join / departure time. I'm going to need to use the report endpoint, instead, but that has a higher scope. ) This is still an issue, and a generic fix to check for pagination is probably the right way to handle it, vs a endpoint specific fix. |
@matthewbarr Thanks for bringing this up! Yes, likely a generic way to handle it will be the best option. If you have any ideas of how you might tackle it, I'm all ears. =) |
I've modified some code I used in a project to be more generic, tested it and so far it seems great: def paginated_get_request(self, endpoint, params=None, headers=None):
if headers is None and self.config.get("version") == API_VERSION_2:
headers = {"Authorization": "Bearer {}".format(self.config.get("token"))}
next_page_token, data = "",{}
while True:
params["next_page_token"] = next_page_token
content = requests.get(self.url_for(endpoint), params=params, headers=headers, timeout=self.timeout).json()
next_page_token = content.get("next_page_token")
for k, v in content.items():
if type(v) == list:
if k in data:
data[k] += v
else:
data[k] = v
if not next_page_token:
break
for k, v in data.items():
content[k] = data[k]
return # What to return? However, I'm a bit stuck on what should be returned in this case (if applied to the main code base). Response objects are meant to be immutable, so there is a bit of a problem there. If anyone has any idea of how/what we should return, I'm all ears as well! |
can you share the code you are using? |
The project I was working on was very much temporary, and I do not have access to the code base anymore. However, it was very similar to what is written above, except it returned |
zoomus/zoomus/components/past_meeting.py
Line 29 in bd79bef
From https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/pastmeetingparticipants:
This request can exceed a single page, and may need to handle the pagination.
The text was updated successfully, but these errors were encountered: