Skip to content

Latest commit

 

History

History
62 lines (48 loc) · 3.17 KB

File metadata and controls

62 lines (48 loc) · 3.17 KB
title External Services
tags
external
core_external
API

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
Loading

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