Note: You are currently viewing documentation for Moodle 2.5. Up-to-date documentation for the latest stable version of Moodle may be available here: Web services FAQ.

Web services FAQ: Difference between revisions

From MoodleDocs
No edit summary
Line 2: Line 2:


== What is the difference between web services and Mnet ==
== What is the difference between web services and Mnet ==
* Mnet is used to authenticate some users from a Moodle A site into a Moodle B site.
* Mnet is used to authenticate some users from a Moodle A site into a Moodle B site.
* Web services are functions that can be called by external application.
* Web services are functions that can be called by external applications (via SOAP, XML-RPC, REST or AMF).
 
 
== I see the term "Web services" used in different ways, what does it mean? ==
 
# The entire system in Moodle is referred to as the Moodle Web Service system.
# A particular action (like creating a user) is known as a Web service '''function'''.
# The admin can enable groups of these functions for outside use, and these are known as a "Web service".
 
 
== Where is the Web Service API documented? ==
 
Since different Moodle sites can extend or restrict the API, and the API will evolve over time, the best way to see the exact API for a particular Moodle site is to look at the automatically generated documentation.
 
#
#
#
 
== Why are there not many functions in the API? ==
 
We have been very careful when adding new functions because we don't want to be changing the API functions once they are implemented.  The ones we have in Moodle 2.0 are the most commonly requested ones (for users, courses, groups and enrolments). 
 
We will add more functions to core over time, based on contributions from the community and feature requests.  See the Moodle tracker for [http://tracker.moodle.org/secure/IssueNavigator.jspa?reset=true&&type=4&type=2&pid=10011&resolution=-1&status=1&status=3&component=10425&sorter/field=priority&sorter/order=DESC a rough roadmap of future web services].  Please contribute with suggestions, votes and code!
 
You can also extend the API on your own Moodle site by creating your own API functions (see next question).
 
== How can I create a new web service function? ==


== The web service API is too small, how to add some new functions? ==
The easiest and recommended way to add a web service is to write a new Moodle local plugin and to implement the web service functions there.   The Moodle administrator will just need to add the plugin in Moodle (copy the files in /local/), the web service functions will be automatically added. Please read /local/readme.txt for more information about plugin development. You can also look at the [http://moodle.org/mod/data/view.php?d=13&rid=4282 Moodle Hub server plugin] as an example.
The easiest and recommended way to add a web service is to write a new Moodle local plugin and to implement the web service functions there. The Moodle administrator will just need to add the plugin in Moodle (copy the files in /local/), the web service functions will be automatically added. Please read /local/readme.txt for more information about plugin development. You can also look at the [http://moodle.org/mod/data/view.php?d=13&rid=4282 Moodle Hub server plugin] as example.


== Is there a roadmap for the web service API? ==
== How can I set up a web service? ==
Currently the web service API task is closed. If you required some new web service functions you can add an issue on [http://tracker.moodle.org/ the tracker], the most voted issues are generally resolved.


== Administrator: how can I set up web service? ==
* See the documents in the [https://docs.moodle.org/en/Category:Web_Services web service category].  
* It exists many document that have been written in the [https://docs.moodle.org/en/Category:Web_Services web service category].  
* In Moodle > Site administration > plugins > Web services > Overview, two use cases are described.
* In Moodle > Site administration > plugins > Web services > Overview, two use cases are described.
* Finally you can go ask question on the [http://moodle.org/mod/forum/view.php?id=6971 Web Services forum]
* Finally you can go ask question on the [http://moodle.org/mod/forum/view.php?id=6971 Web Services forum]

Revision as of 04:22, 24 November 2010

This document lists some popular questions from the Web Services forum.

What is the difference between web services and Mnet

  • Mnet is used to authenticate some users from a Moodle A site into a Moodle B site.
  • Web services are functions that can be called by external applications (via SOAP, XML-RPC, REST or AMF).


I see the term "Web services" used in different ways, what does it mean?

  1. The entire system in Moodle is referred to as the Moodle Web Service system.
  2. A particular action (like creating a user) is known as a Web service function.
  3. The admin can enable groups of these functions for outside use, and these are known as a "Web service".


Where is the Web Service API documented?

Since different Moodle sites can extend or restrict the API, and the API will evolve over time, the best way to see the exact API for a particular Moodle site is to look at the automatically generated documentation.

Why are there not many functions in the API?

We have been very careful when adding new functions because we don't want to be changing the API functions once they are implemented. The ones we have in Moodle 2.0 are the most commonly requested ones (for users, courses, groups and enrolments).

We will add more functions to core over time, based on contributions from the community and feature requests. See the Moodle tracker for a rough roadmap of future web services. Please contribute with suggestions, votes and code!

You can also extend the API on your own Moodle site by creating your own API functions (see next question).

How can I create a new web service function?

The easiest and recommended way to add a web service is to write a new Moodle local plugin and to implement the web service functions there. The Moodle administrator will just need to add the plugin in Moodle (copy the files in /local/), the web service functions will be automatically added. Please read /local/readme.txt for more information about plugin development. You can also look at the Moodle Hub server plugin as an example.

How can I set up a web service?

  • See the documents in the web service category.
  • In Moodle > Site administration > plugins > Web services > Overview, two use cases are described.
  • Finally you can go ask question on the Web Services forum