Using CANVAS API to assign/delete peer reviews for an assignment

Jump to solution
TaiLi
Community Member

I am facing the exact same issue that @maguire mentioned here:

https://community.canvaslms.com/t5/Canvas-Developers-Group/All-things-API/m-p/50687/highlight/true

 

While I am able to add and delete individual peer reviews for a user through the GUI, I am unable to do it using the api as mentioned at https://canvas.instructure.com/doc/api/all_resources.html#method.peer_reviews_api.create.

 

Here is what my code looks like:

assign_peer_review_url = "https://<infra domain>/api/v1/courses/<courseid>/assignments/<assignment id>/submissions/<user_id_corresponding_to_this_submission>/peer_reviews"
data = {}
data['user_id'] = int(<user_id_of_the_user_who_is_supposed_to_review_the_submission>)
x = requests.post(assign_peer_review_url, json = dict(data), headers=canvas_token)

 


I have double checked the IDs and all of them are correct. I am still getting a 404 error. What could be wrong?

 

Thank you for the help!

 

Labels (1)
0 Likes
1 Solution
maguire
Community Champion
<user_id_corresponding_to_this_submission>
should be
the submission_id

as per 

POST /api/v1/courses/:course_id/assignments/:assignment_id/submissions/:submission_id/peer_reviews

 

View solution in original post