Moodle webservice core_role_assign_roles dont works for course_categories

Moodle webservice core_role_assign_roles dont works for course_categories

by Moritz Grey -
Number of replies: 1

Hey Everyone, 


i want to give the user id: 4 for coursecategorie: 1049 the role: 2 (coursecreater)

Here is my Curl:


MyMoodle/webservice/rest/server.php?wstoken=MyToken&wsfunction=core_role_assign_roles&moodlewsrestformat=json&assignments[0][roleid]=2&assignments[0][userid]=4&assignments[0][contextid]=1&assignments[0][contextlevel]=coursecat&assignments[0][instanceid]=1049

i get as answer "null", it works. But i do not see the user with the id 4 in the coursecategorie 1049 as coursecreater.

Whats wrong on my curl?

Thanks for help!


Average of ratings: -
In reply to Moritz Grey

Re: Moodle webservice core_role_assign_roles dont works for course_categories

by Moritz Grey -
If i use --> assignments[0][contextid]=0 <-- it works for course_categoris...