Problem Description
I am trying to enroll a user on my Moodle site via using the Moodle API.
My Moodle instance is hosted on AWS and all relevant ports are open and listening. So, from the network perspective, I can commit that is all ok.
The steps I have already done based on Moodle Documentation:
1. I have enabled web services on `Administration > Mobile app >Mobile settings`
2. I have gone through the 10 steps on the overview of allowing an external system to control Moodle as explained in the documentation (shown also in [this Youtube video][1])
For testing purposes, I am using **Postman**. Some requests are going through (e.g. getting the token for a certain user, getting the list of all courses, etc.)
Example:
[![enter image description here][2]][2]
But when I try to i.e. **create a user** or **enroll a user** in an existing course I am getting this error:
{
"exception": "webservice_access_exception",
"errorcode": "accessexception",
"message": "Access control exception"
}
The way I am trying to i.e. create the user is as follows:
[![enter image description here][3]][3]
In the body section I am sending the following data:
- users[0][username]
- users[0][email]
- users[0][lastname]
- users[0][firstname]
- users[0][password]
Based on my research, most of the contributors suggested enabling web services, but as mentioned above I have enabled them but the problem persists.
Can someone help me solve the issue here or maybe suggest a way of debugging it?
[1]: https://www.youtube.com/watch?v=KCNA5eo5q-Q
[2]: https://i.sstatic.net/pV00R.png
[3]: https://i.sstatic.net/YW5v5.png
AI-Generated Solution
Powered by LMSouq AI · GPT-4.1-mini
Analyzing problem and generating solution…
Was this solution helpful?