Using CANVAS API to assign/delete peer reviews for an assignment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022
01:17 AM
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!
Solved! Go to Solution.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022
05:12 AM
<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