users API page_views per_page limit?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017
03:57 PM
Working with the users API and the page_views call. I have used a page_views=2000 or some such number on other APIs, but this doesn't seem to work with the /users/xxxx/page_views?per_page=2000
I know I can use the pagination, but... wondering why the per_page doesn't seem to work.
Bruce
Solved! Go to Solution.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017
04:06 PM
per_page does work, but it most cases there's an upper limit of 100.
You can check the Link response header and see exactly what the limit is. For that particular call, it is 100.
When I call this
https://richland.instructure.com/api/v1/users/self/page_views?per_page=2000
I get headers like this:
The cure to pagination is not to make the per_page excessively high -- that will fail at some point. It's to look at the link response header and get the next link.