Follow the step by step instructions below to setup your external services
Step 1. Enable web services- How to enable web services
Web services must be enabled in Advanced features
Step 2. Enable protocols - Enable protocols for Web services
At least one protocol should be enabled. For security reasons, only protocols that are to be used should be enabled.
Step 3. Create a specific user to be utilised by web services - Create a new user
A web services user is required to represent the system controlling Moodle.
Step 4. Check user capability - Creating a New Role and Editing a Role's Permissions
The user should have appropriate capabilities according to the protocols used, for example webservice/rest:use, webservice/soap:use. To achieve this, create a web services role with protocol capabilities allowed and assign it to the web services user as a system role.
Step 5. Select a service - Setting up a new external service
A service is a set of web service functions. You will allow the user to access to a new service. On the Add servicepage check 'Enable' and 'Authorised users' options. Select 'No required capability'.
Step 5. Add functions - Setting up a new external service
Select required functions for the newly created service.
Step 6. Select a specific user - Setting up a new external service
Add the web services user as an authorised user.
Step 7. Create a token for the web services user - How to create a web service token
Create a token for the web services user.
Step 8. Test the service
Simulate external access to the service using the web service test client. Use an enabled protocol with token authentication. WARNING: The functions that you test WILL BE EXECUTED, so be careful what you choose to test!
Some additional Web Services documentation that you may find useful:
- MoodleDocs: Creating a web service client-
https://docs.moodle.org/dev/Creating_a_web_service_client - MoodleDocs: Using Web services
https://docs.moodle.org/36/en/Using_web_services#Enabling_web_services