/api/v1/users/:user_id/files/quota UNAUTHORIZED

Jump to solution
erlend_thune
Community Contributor

I am trying to use

/api/v1/users/:user_id/files/quota

documented here Canvas LMS REST API Documentation

F.ex. https://ikt.instructure.com/api/v1/users/312/files/quota

Even when I am logged in as an administrator, I get "while(1);{"status":"unauthorized","errors":[{"message":"user not authorized to perform that action"}]}"

My plan was to get an overview of the quota used by all the students to see if we should increase it.

1 Solution
garth
Community Champion

 @erlend_thune ​ it seems you have two options here:

  • Implement OAuth2 and request a token on the users behalf
  • Impersonate the user

If this is an interal report, Masquerading would likely be the easiest approach.

Your syntax for the call would look like this:  

/api/v1/users/:user_id/files/quota?as_user_id=:user_id

Let me know if this helps.

View solution in original post