Skip to main content
Version: 4.5

External Services

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.

Plugin APIExternal APIProtocol ServerLogin EndpointClientPlugin APIExternal APIProtocol ServerLogin EndpointClientAuthentication using Username and PasswordThe Session token is used to confirm user permission against the specified API.Login attemptedSession tokenFunction and authentication tokenAccess Control CheckAuthentication grantedFunction called against relevant APIResult passed back to Protocol serverReturn value validatedValidated data returned to Client

Developer documentation

The External Service API has two categories of documentation:

  1. this documentation details how to write a web service and use the External API; and
  2. 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.

Specification and brainstorming

See also