API change? Course created in wrong account.

Jump to solution
alexei-bezpaltc
Community Explorer

Hello.

Just a few days ago this code:

string command = "/api/v1/accounts/18/courses";

var courseData = new { name=courseName, course_format="blended", account_id= "18", start_at =startDate, ends_at=endDate};
string jsonContent = JsonConvert.SerializeObject(new { course = courseData });
var httpContent = new StringContent(jsonContent, Encoding.UTF8, "application/json");

var response = await httpHelperCanvas.PostCommandAsync(command, httpContent);

was creating a course in account #18, BUT today it creates a course in account #1

Have Instructure changed something in API? Any idea what's going on?

Additionally I have tried to update new course to move it in my account:

string command = "/api/v1/courses/<NewCourseId>";
var courseData = new { account_id="18"  };
string jsonContent = JsonConvert.SerializeObject(new { course = courseData });
var httpContent = new StringContent(jsonContent, Encoding.UTF8, "application/json");

var response = await httpHelperCanvas.PutCommandAsync(command, httpContent)

It returns 200 but doesn't do anything.

Thank you for any input!

========================================

Apparently there was an issue with the system.

Beta had stalled on several jobs, At the end of the day everything started working, and a bunch of my "lost" courses appeared without any further actions from me.

Thank you everybody for the help.

1 Solution
alexei-bezpaltc
Community Explorer
Author

Apparently there was an issue with the system.

Beta had stalled on several jobs, At the end of the day everything started working, and a bunch of my "lost" courses appeared without any further actions from me.

Thank you everybody for the help.

View solution in original post