Course is not published

Jump to solution
alexei-bezpaltc
Community Explorer

Hello!

I'm using API to create courses.

 

string command = "/api/v1/accounts/:account_id/courses";
string courseData = new { name=courseName, offer="true", start_at =startDate, ends_at=endDate};

 

after this call I add a teacher, and create migration to copy template into this course.

At the end course is 'Unpublished" IE students can not access it. According to documentation offer="true" should set course to "Published" state but it doesn't. Even if I update the course later

            string command = "/api/v1/courses/:id";
            var courseData = new { offer = "true" };

It is still doesn't become "Published"

Have something changed in the API? Is documentation incorrect?

What I need to do to set course to "Published"?

Thank yo very much!

Labels (3)
0 Likes
1 Solution
alexei-bezpaltc
Community Explorer
Author

Offer is a separate object, not part of the course.

JsonConvert.SerializeObject(new { course = courseData, offer="true" });

then it works.

View solution in original post