The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
We have various implementations of the Canvas REST API, which we've been using for years. We recently added a version in Javascript and just finished the code to use paging using the 'next' header link. The mechanism works well and we receive the data requested.
However, for Rubrics no matter how many there are defined in a course, and no matter what we set the per_page argument to, we only get back the first 10. We tried this in our code and straight up in Postman and we keep seeing the same results.
Is this a potential bug or are we overlooking something?
I've run into the same issue, and that appears to be expected behavior. Resources have different limits, as mentioned in the REST API Pagination Documentation (first paragraph, third sentence).
The per_page argument doesn't mean the total amount of items you get back, it's the max number you want to get back per request. So let's say there are 350 items in the data set you're retrieving and you've set your per_page to 50, then you're going to get 7 pages back of 50 items (using the next header), meaning you'll need 7 requests. We set the per_page to 100 by default and this always gives us exactly what we need. In the case of Rubrics, no matter what or how we request, we get 10 items back maximum, even if there are let's say 17 Rubrics.
Hi @martinv2,
I think what @AlexJackson was referring to is this statement in the API Pagination document: "There is an unspecified limit to how big you can set per_page to, so be sure to always check for the Link header." So while most calls do support setting per_page to 100, it's not guaranteed that every single API will support that. In order to ensure you receive all results, you do need to look at the header links and continue to make API results until you reach the end. Sometimes you can somewhat cheat the system and ser per_page to 100 and get all of the results you need, but just setting per_page is no guarantee that page 1 will have everything you want, and again, sometimes there are APIs that only return a max or 10 results per page no matter what you try to set that parameter to.
Hope this helps!
-Chris
We we understand how paging works. We've been using that for years like I stated before.
I think we're missing some information. Are you saying that even if there are 17 rubrics in a course, you get 1 page with 10 rubrics and no further pages? As in the next link in the Link Header is empty/not present?
Yes that is correct, that's the behavior we're seeing.
Thanks @AlexJackson for pointing out what we ere missing... This extra bit of info on the problem definitely helps.
With that said, I'm unable to replicate this myself... using /api/v1/courses/:course_id/rubrics, I get the first 10, then using the next link, I get the next set (I just quickly created 10 rubrics, call 1 returned 1-10, call 2 returned 11-12). Is this the APi call you're ruing @martinv2?. I even tried setting the per_page on this, and i did give me all 12 results in one call, so perhaps I'm testing the wrong call. Any more specifics you can give would be great!
-Chris
This is the third issue I've seen in the last month with people not getting all of their rubrics (not matching the count on the rubrics page).
I originally thought that it might be a case of course-level vs account-level rubrics. The call to get the rubrics is dependent on where the rubric lives so if there were 17 rubrics, 7 account-level and 10 course-level, you would only get 10 returned from the course, no matter what per_page you used. For example, my sandbox has 27 course rubrics and one account rubric. The rubric page shows 28 rubrics, but the API call with per_page=50 to get the course rubrics only returns the 27.
But one of the people said that they discovered the problem was that they had actually deleted some of the rubrics. They were trying to import course content and the rubric was no longer there.
Given the recent rash of issues, it seems not coincidental, that Canvas is working on and getting ready to release a rubrics redesign. Prior to the three messages this last month, I don't remember seeing any similar issues (I've been in the Community since 2014).
For the course we were testing with we were only getting 10 Rubrics when there are 12 displayed on the page in the course. But it gets weirder, on a different course we're getting more Rubrics than there are shown the course! For example, this is a course we're testing with:
However, when we use the API to get the Rubrics we get 2 more!
id: 255, title: Question Rubric
id: 257, title: Data Cleaning Rubric
id: 258, title: Question Rubric (1)
id: 271, title: Byte 3
id: 333, title: Midterm Project Rubric
id: 403, title: Exam Question Rubric
id: 404, title: Long Question Rubric
id: 411, title: Long Question Rubric (1)
id: 412, title: Long Question Rubric (2)
We can take the id of one of the Rubrics not displayed in the page and actually navigate to a page that shows that Rubric's content as expected. Even though in the course page it doesn't even appear. (The extra Rubrics are not under the Archived tab, we checked)
It looks like the current design renders the Rubrics page server side when the page is initially loaded and doesn't make any API calls to load in the list of rubrics for the course. However, with the Rubric Redesign, I see they are making a GraphQL request to get the rubric connections for the course.
I wonder if there is something different about how the REST API handles the request vs how GraphQL handles the request.
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in