AnsweredAssumed Answered

Error Posting to Enrollments - C#

Question asked by Katie Favara on Apr 26, 2017
Latest reply on Apr 27, 2017 by Nazmus Nasir

I am using C# to post to the API. I have been successful creating users and courses, however, I cannot seem to get my users enrolled. 

 

I have created the user using the API and I can successfully GET the user using https://url.instructure.com/api/v1/users/sis_user_id:usernumber

I have created the course and I can successfully GET the course using https://url.instructure.com/api/v1/courses/sis_course_id:coursenumber

 

I am sending a POST statement to 

https://url.instructure.com/api/v1/courses/sis_course_id:coursenumber/enrollments

and sending the json data of 
{"enrollment":{"sis_user_id":"usernumber","type":"TeacherEnrollment"}}

 

I receive a 403 error. I have admin rights and can create users with my user and token. I have read elsewhere that the 403 error can also mean bad data, but my data appears to be correct. 

 

Thanks for your help.

Outcomes