| title | External Services | |||
|---|---|---|---|---|
| tags |
|
Moodle has a full-featured Web Service framework, allowing you to use and create web services for use in external systems. The Web Service framework and the External API work closely together providing a number of Endpoints, and self-describing classes to support a wide range of uses.
Moodle uses these web services internally for:
- AJAX interactions in the Moodle Web Interface; and
- The official Moodle Mobile App.
The following example shows a typical authentication and protocol workflow.
sequenceDiagram
Client ->> Login Endpoint: Login attempted
Note right of Client: Authentication using <br> Username and Password
Login Endpoint ->> Client: Session token
Client ->> Protocol Server: Function and authentication token
Protocol Server -->> External API: Access Control Check
Note right of Protocol Server: The Session token is <br>used to confirm <br> user permission against <br> the specified API.
External API -->> Protocol Server: Authentication granted
Protocol Server ->> Plugin API: Function called against <br> relevant API
Plugin API ->> Protocol Server: Result passed back to Protocol server
Protocol Server -->> External API: Return value validated
Protocol Server ->> Client: Validated data returned to Client
The External Service API has two categories of documentation:
- this documentation details how to write a web service and use the External API; and
- API documentation for a live Moodle site, which can be found under ** Site administration > Server > Web services > API Documentation **.
In addition to the standard API endpoints, several additional API endpoints are available for the purpose of uploading, and downloading, files. For more information on these endpoints, see the file handling documentation.
- How to contribute a web service function to core
- Adding a web service to your plugin
- Code example: Adding a web service, using APIs by (Tim Hunt)
- Implement a web service client
- Web services files handling
- Web service Listing & Roadmap
- Web service API functions
- Web services FAQ
- How to create and enable a web service
- How to enable the mobile web service
- Web services user documentation
- Mastering Moodle Web Services development - Last session of the Hackfest in the MoodleMoot UK 2016