Change User Role
This endpoint allows user managers to change the role of some users in the specified course.
At least one parameter between managers, joined and unjoined is required.
note
The creator of the course cannot be removed from the managers.
info
This operation requires the course manager role.
HTTP Request
POST /api/v2/course/{id}/role/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | A unique integer value identifying this course |
managers | body | list(integer) | false | List of id of User to set as managers role |
joined | body | list(integer) | false | List of id of User to force to join the course as normal users |
unjoined | body | list(integer) | false | List of id of User to force to unjoin the course |
Example Request
- JavaScript
- Bash
const inputBody = '{
"managers": ["integer"],
"joined": ["integer"],
"unjoined": ["integer"]
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};
fetch('/api/v2/course/{id}/role/',
{
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/{id}/role/ \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json'
-H 'Authorization: Bearer {access_token}'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Response status code | None |