users API page_views per_page limit?

Jump to solution
harrison
Community Novice

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

Labels (1)
1 Solution
James
Community Champion

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:

248740_pastedImage_1.png

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. 

View solution in original post