cancel
Showing results for 
Search instead for 
Did you mean: 
rancho
Surveyor II

404 error for deactivating an enrollment.

Jump to solution

I am sure this is something easy, but I can not see it.  I want to deactivate an enrollment in a class.  I am looking at this documentation.

DELETE /api/v1/courses/:course_id/enrollments/:id

Scope: url:DELETE|/api/v1/courses/:course_id/enrollments/:id

Conclude, deactivate, or delete an enrollment. If the task argument isn't given, the enrollment will be concluded.

Request Parameters:

Parameter   Type Description
task   string

The action to take on the enrollment.

 

I am using this url and sending as a HTTP DELETE


 

https://XXX/api/v1/courses/44727/enrollments/29569?task=deactivate 

 

the documentation said the task parameter was optional and would default to concluded.  So I tried that as well, and still received the 404.

Thanks bob

0 Kudos
1 Solution

Accepted Solutions
matthew_buckett
Adventurer II

The 404 means it can't find something. Where did you get the enrolment ID from? the enrolment ID is different from the user ID so if you are trying to conclude an enrolment for a user, you first have to find out the enrolment ID for the user ID.

Depending on what you are wanting to do there are various ways to find enrolment IDs: https://canvas.instructure.com/doc/api/enrollments.html#method.enrollments_api.index

If you are doing bulk updates I would recommend using a provisioning report and a SIS Import, rather than making lots of API calls. It will be faster, but also is easier to test and revert/recover if something does wrong. SIS Imports also have a log of all the changes that have been run which can make debugging problems much easier.

View solution in original post

0 Kudos
2 Replies
matthew_buckett
Adventurer II

The 404 means it can't find something. Where did you get the enrolment ID from? the enrolment ID is different from the user ID so if you are trying to conclude an enrolment for a user, you first have to find out the enrolment ID for the user ID.

Depending on what you are wanting to do there are various ways to find enrolment IDs: https://canvas.instructure.com/doc/api/enrollments.html#method.enrollments_api.index

If you are doing bulk updates I would recommend using a provisioning report and a SIS Import, rather than making lots of API calls. It will be faster, but also is easier to test and revert/recover if something does wrong. SIS Imports also have a log of all the changes that have been run which can make debugging problems much easier.

View solution in original post

0 Kudos

@matthew_buckett 

Thanks again for the help.  Yeah I knew the 404 was not found.  But I was thinking it was a page not found, not a student not found.  And yes I was sending up the canvas student id.  I assumed again it would have been based on the student id and course number.  Thanks for the link on getting enrollment ids.  

Again you have been a life saver for me.  I wish I could send over a six pack of some great craft beer for all your help.

cheers

bob