Found this content helpful? Log in or sign up to leave a like!

Get submission for all the users for course

Jump to solution
test29
Community Member

Submission api is not working /api/v1/courses/116/students/submissions 
i have tried root token and sub account token also for both its giving only 

{
    "status": "unauthorized",
    "errors": [
        {
            "message": "user not authorized to perform that action"
        }
    ]
}

 

Labels (1)
0 Likes
2 Solutions
melodyc_lam
Community Coach
Community Coach

@test29 Welcome! This API endpoint requires request parameters to retrieve submission data, otherwise it defaults to retrieving your submissions (which you may not have any in the course.) Could you provide a sanitized version of what code or call you're trying to make on this endpoint? That will help us troubleshoot your call. Thanks!

View solution in original post

0 Likes

Hi @test29,

As @melodyc_lam mentioned, the call you're trying to use needs additional parameters to specify which students you're trying to get submissions for, otherwise it defaults to trying to get submissions for the owner of the API token (which is you, and you're not a student, therefore submissions doesn't make sense and probably leads to that error message).  The relevant parameter you need to look at in the API documentation is student_ids[].  If you want to get all submissions for all students, simply adding '&student_ids[]=all' to your URL should do the trick.

Hope this helps!

-Chris

View solution in original post