Enabling the web services in moodle requires you to have administrator access. For a detailed overview go to: Site Administration > Server > Web Services > Overview
Enable web services Web services must be enabled in Advanced features.
Enable protocols At least one protocol should be enabled. For security reasons, only protocols that are to be used should be enabled.
Create a specific user A web services user is required to represent the system controlling Moodle.
Check user capability 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.
Select a service A service is a set of web service functions. You will allow the user to access to a new service. On the Add service page check 'Enable' and 'Authorised users' options. Select 'No required capability'.
Add functions Select required functions for the newly created service.
Select a specific user Add the web services user as an authorized user.
Create a token for a user Create a token for the web services user.
Enable developer documentation Detailed web services documentation is available for enabled protocols.
Test the service Simulate external access to the service using the web service test client. Use an enabled protocol with token authentication.
Testing Live Environments
The functions that you test WILL BE EXECUTED, so be careful what you choose to test
Check User Capability
Step 4 requires you to create a role go to: Site Administration > Users > Define Roles
Select Archetype Choose Authenticated User
Select Capabilities Choose the Web Services it needs to be able to access.
Click Create Role
Select a service and add functions
Step 5 and 6 require you to add a service and configure the functions. Go to: Site Administration > Server > Web Services > External Services.
At the bottom click Add
Fill in the external service form
Click Add Service
Click Add Functions
Select Appropriate Functions from the dropdown
Click Add Functions
Select a specific user
Step 7 requires you to authorize a user for api access. Go to: Site Administration > Server > Web Services > External Services.
Click Authorized Users
Move the API user to the left column
Check the capabilities for the user at the bottom, it will list add the missing capabilities.
Go back to the role and all the missing capabilities.
Create a token for the user
Step 8 requires you to create a token for the user. Go to: Site Administration > Server > Web Services > Manage Tokens.
Click Create Token
Fill out the form
Click Save Changes to create the token.
The API has now been setup, all that is left is setting up Power BI to start importing data.
I like to see who's visiting my website, do you accept?
Enabling the web services in moodle requires you to have administrator access.
For a detailed overview go to: Site Administration > Server > Web Services > Overview
Web services must be enabled in Advanced features.
At least one protocol should be enabled. For security reasons, only protocols that are to be used should be enabled.
A web services user is required to represent the system controlling Moodle.
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.
A service is a set of web service functions. You will allow the user to access to a new service. On the Add service page check 'Enable' and 'Authorised users' options. Select 'No required capability'.
Select required functions for the newly created service.
Add the web services user as an authorized user.
Create a token for the web services user.
Detailed web services documentation is available for enabled protocols.
Simulate external access to the service using the web service test client. Use an enabled protocol with token authentication.
Check User Capability
Step 4 requires you to create a role go to: Site Administration > Users > Define Roles
Choose Authenticated User
Choose the Web Services it needs to be able to access.
Select a service and add functions
Step 5 and 6 require you to add a service and configure the functions.
Go to: Site Administration > Server > Web Services > External Services.
Select a specific user
Step 7 requires you to authorize a user for api access.
Go to: Site Administration > Server > Web Services > External Services.
Create a token for the user
Step 8 requires you to create a token for the user.
Go to: Site Administration > Server > Web Services > Manage Tokens.
The API has now been setup, all that is left is setting up Power BI to start importing data.