Skip to content
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

Canvas' default return maximum 10 items per request #55

Closed
Beebeeoii opened this issue Aug 5, 2022 · 2 comments
Closed

Canvas' default return maximum 10 items per request #55

Beebeeoii opened this issue Aug 5, 2022 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@Beebeeoii
Copy link
Owner

Describe the bug
Requests that return multiple items will be paginated to 10 items by default. To retrieve more items, you can either append a ?per_page parameter or utilise the Link header to check if the next page exists and if it does, get the next page of items.

Currently, this wasn't taken into account and at max, 10 items are returned for requests that might actually return more than 10 items (for example files in a folder).

For ref: https://canvas.instructure.com/doc/api/file.pagination.html

@Beebeeoii Beebeeoii added the bug Something isn't working label Aug 5, 2022
@Beebeeoii
Copy link
Owner Author

Possible to look into a recursive kind of check for existence of next page for Canvas APIs?

Idea: After building a Request, Send() will not just retrieve the response for that request, but also check if there are additional pages for that response via the response header. If there is, append to the original response. Repeat until the last page.

@Beebeeoii
Copy link
Owner Author

this should be fixed with #102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant