Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2361

enrol_manual_enrol_users without enrolling the web service user

$
0
0
by Max Longus.  

Hello,

Is it possible to enrol users in a course by REST web service without previously manually enrolling the web service user in that course ?
I have to create a lot of courses in Moodle and i must enrol teachers and students in these courses.
I would like to do this by the web service API.
I can easily create courses with REST.
But i cannot enrol teachers in that course with enrol_manual_enrol_users, i have an exception :
<EXCEPTION class="require_login_exception">
<ERRORCODE>requireloginerror</ERRORCODE>
<MESSAGE>Cours ou activité pas accessible.</MESSAGE>           "Course or activity not accessible"
</EXCEPTION>

 The only way i found to enrol a teacher with enrol_manual_enrol_users is to manually enrol the web service user in the course. Is there a solution to get around that problem  in order to have a complete automatic process ?

Thanks.


Viewing all articles
Browse latest Browse all 2361

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>