Create a Course
This endpoint creates a course.
info
This operation requires authentication.
HTTP Request
POST /api/v2/course/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | Course | true | The request body (course params) |
Example Body Parameters
- JSON
{
"name": "string",
"description": "string",
"type": "string",
"privacy": "string",
"image_original": "string",
"categories": [integer]
}
Example Request
- JavaScript
- Bash
const inputBody = '{
"name": "string",
"description": "string",
"type": "string",
"privacy": "string",
"image_original": "string",
"categories": [integer]
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};
fetch('/api/v2/course/',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST /api/v2/course/ \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json'
-H 'Authorization: Bearer {access_token}'
--DATA '{body}'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Response status code | Course |