Create/Update course
Method
| Method | Description |
|---|---|
| course.courseCreate | Create course. |
| course.courseUpdate | Update course. |
Request parameters
{
"course": {
"id": {CourseId}, /* Only for update operation */
"title": "{CourseTitle}",
"category": "{CourseCategory}",
"code": "{CourseCode}",
"show_toc": {ShowToc},
"description": "{Description}"
}
"resources": {
"{ResourcePath}": "{ResourceCnt}",
...
}
}
Response parameters
{
"course": {
"id": {CourseId},
...
},
"resources": {
"{ResourcePath}": "{NewResourcePath}",
...
},
"completed": {Comleted}
}
If a specific option is completely omitted from the request, it will not be updated, and the previously stored value will be preserved.
| Variable | Type | Appearance | Description |
|---|---|---|---|
| {CourseId} | Integer | Mandatory | Course id. |
| {CourseTitle} | String | Mandatory | Course title. |
| {CourseCategory} | String | Mandatory | Course category. |
| {CourseCode} | String | Mandatory | Course code. |
| {ShowToc} | Boolean | Optional | If enabled, a table of contents is automatically generated from page names; page names are also used as headings when page content is displayed. Enabled by default. |
| {Description} | String | Optional |
Course description content. HTML formatted, may contain media resources like images and audio. Please be aware that only relative URLs are allowed. See Rich HTML formatting for the full list of supported tags and attributes.
If omitted from the request, the existing value is preserved and not cleared. Required before the course can be marked as ready. The first image will be used as the social media preview image. If none is available, one will be be generated automatically. |
| resources | Object | Optional | If you are using media resources like images you need to send the content of each media resource under "resources" node. |
| {ResourcePath} | String | Mandatory | Path of media resource. Same value as it was used in Description. Example: "fld/image.jpg" for <img src="fld/image.jpg">. |
| {ResourceCnt} | String | Mandatory | Base64 encoded content of media resource. |
| {NewResourcePath} | String | Mandatory | New media resource path. |
| {Completed} | Boolean | Mandatory | Indicates whether action was successfully completed or not. |
