talway
Community Contributor

REST API to Delete User returns error

Jump to solution

I am trying to configure the following API to delete users from a course:  https://[my domain]:443/api/v1/courses/[courseid]/enrollments/[userid]?task=delete.  I am testing it on the TEST site by using both PostMan and the Canvas LIVE API.  However, regardless of which on that I use, I get the following message:  {"errors":[{"message":"The specified resource does not exist."}]}.  I have confirmed that the course ID, User ID are correct.  The authorization token is creating using an admin account.  What am I missing?

Thank you.

Labels (1)
Tags (1)
0 Kudos
1 Solution
JeffW
Community Participant

Hi @talway!

I believe the issue there is you need the enrollment_id, not the user_id.

 https://[my domain]:443/api/v1/courses/[courseid]/enrollments/[enrollmentid]?task=delete

 

I snagged the attached image from the API documentation here - https://canvas.instructure.com/doc/api/enrollments.html

View solution in original post

0 Kudos
2 Replies
JeffW
Community Participant

Hi @talway!

I believe the issue there is you need the enrollment_id, not the user_id.

 https://[my domain]:443/api/v1/courses/[courseid]/enrollments/[enrollmentid]?task=delete

 

I snagged the attached image from the API documentation here - https://canvas.instructure.com/doc/api/enrollments.html

0 Kudos
talway
Community Contributor

Thank you.  I did not catch that there was yet another ID besides the Canvas user_id and the SIS_ID.

0 Kudos