Course API page is not working

Jump to solution
greg_zhang
Community Novice

I was using this API to get all users enrolled in course, there are more than 1000 users in the course, it worked before , but now no matter the page is it's only return same 100 results. 

/api/v1/courses/8773/enrollments?per_page=100&page=1

/api/v1/courses/8773/enrollments?per_page=100&page=2

0 Likes
1 Solution
James
Community Champion

 @greg_zhang  

Canvas has switched to using bookmarks for the enrollments API and the numeric pages are no longer supported. See 2020-06-20 in the Canvas API change log. It was announced several months before (I don't remember when exactly, but I was warning people about it back in February 2020). Still several people missed the announcement.

Officially, they were never supported, they were just used and a bunch of people wrote their code based off the pattern that was used. You need to follow the documentation on using Pagination about using the Next link header to determine the proper page in the sequence.

View solution in original post

0 Likes