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!
Hi fellow developers!
I'm new to the canvas platform, but excited to get started. I am awaiting a response from the admins about getting an API token, and in the meantime have been poking around in the console while logged in (I'm a student, so I am running these commands while signed into my student account where I have active classes).
I'm interested in getting the current student's grade on a particular assignment. I tried this command:
$.getJSON("/api/v1/courses/<course id>/assignments/<assignmend id>/submissions", function(data) { console.log(data); });
But I got a 401 unauthorized return status. Do I need to have an API token to run this, or am I missing something else? I can fetch my classes and assignments just fine through the console.
Thanks,
Nick
401 usually means you are unauthorized to run the command. The API call you are wanting to invoke returns assignment submissions for all users that participated in that assignment. Somebody correct me if I am wrong but you will need admin rights to make this call.
Edit: To better answer your question, yes you will need a key to make this API call.
To follow up on this, I was able to generate an API key with my student (non admin) account, and perform the following:
GET https://school.instructure.com/api/v1/courses/:course_id/quizzes/:quiz_id/submissions
I did not get any thrown errors letting me know I was unauthorized to make that API call. When invoking this call as a non-admin it returns your assignment submissions only. You can still obtain an API key by going to Account --> Settings --> New Access Token. Then, for each API call you need to pass that API key in your request header.
If you are accessing it as a student, add self or :userid at the end....
$.getJSON("/api/v1/courses/<course id>/assignments/<assignmend id>/submissions/self", function(data) { console.log(data); });
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