Web services: Difference between revisions
From MoodleDocs
No edit summary |
|||
Line 1: | Line 1: | ||
{{Managing a Moodle site}} | {{Managing a Moodle site}} | ||
Web services enable other systems to login to Moodle and perform operations. | Web services enable other systems to login to Moodle and perform operations. | ||
=== How it works === | |||
This simple example will give you an idea of how our web services infrastructure works. | |||
#The client sends a username and password to the web service login script. | |||
#The script returns a token for that user account. | |||
#The client calls a particular web service function on a protocol server including the token . | |||
#The protocol server uses the token to check that the web service session is still active. | |||
#The protocol server call the matching external function, located in a externallib.php file inside the relevant module. | |||
#The external function checks that the current user has_capability to do this operation. | |||
#The external function calls the matching Moodle core function (in lib.php usually). | |||
#The core function can return a result to the external function. | |||
#The external function will return a result to the protocol server. | |||
#The protocol server returns the result to the client. | |||
== Administrator documentation == | == Administrator documentation == |
Revision as of 10:41, 1 November 2011
Web services enable other systems to login to Moodle and perform operations.
How it works
This simple example will give you an idea of how our web services infrastructure works.
- The client sends a username and password to the web service login script.
- The script returns a token for that user account.
- The client calls a particular web service function on a protocol server including the token .
- The protocol server uses the token to check that the web service session is still active.
- The protocol server call the matching external function, located in a externallib.php file inside the relevant module.
- The external function checks that the current user has_capability to do this operation.
- The external function calls the matching Moodle core function (in lib.php usually).
- The core function can return a result to the external function.
- The external function will return a result to the protocol server.
- The protocol server returns the result to the client.
Administrator documentation
User documentation
Most of the time, the client application will retrieve the key (token) for a user. However, it is still possible for a user to view the key and to regenerate it.
Developer documentation
The full API can be founnd on any Moodle sites under Administration block > Plugins > Web services > API Documentation.
- Implement a web service and a web service function
- Implement a web service client
- Web service Roadmap
See also
Sharing knowledge:
- The official discussion forum is here
- Web services FAQ
Specification / core development:
Other implementations: