Moodle web service

Moodle web service

by noel Mdala -
Number of replies: 2

Hello i am new here and i am having some problems with moodle web service i have created a rest service in older to connect it to my student management system but when i use one of moodles function to retrieve data from it i receive this error 

<?xml version="1.0" encoding="UTF-8" ?>

<EXCEPTION class="webservice_access_exception">
<ERRORCODE>accessexception</ERRORCODE>
<MESSAGE>Access control exception</MESSAGE>
</EXCEPTION>
so can someone help me out please 
Thanks 😌
Average of ratings: -
In reply to noel Mdala

Re: Moodle web service

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

If you change Debug messages to "DEBUG" (under Site administration → Development → Debugging) you should find that the output includes a more detailed description, e.g. if I make a test call to core_course_create_categories:

<MESSAGE>Access control exception (Access to the function core_course_create_categories() is not allowed.
There could be multiple reasons for this:
1. The service linked to the user token does not contain the function.
2. The service is user-restricted and the user is not listed.

Hopefully this will help troubleshoot why the REST call isn't working.

(Don't forget to change Debug messages back to "NONE" when you've finished).

In reply to noel Mdala

Re: Moodle web service

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
There's lots of steps you need to take to get web services working - miss any and it won't work.

Go to Site administration > Plugins > Web services > Overview, check your way through the list.