<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stevehurcombe</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stevehurcombe"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/Special:Contributions/Stevehurcombe"/>
	<updated>2026-04-18T08:21:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development_talk:Web_services&amp;diff=31308</id>
		<title>Development talk:Web services</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development_talk:Web_services&amp;diff=31308"/>
		<updated>2008-01-15T15:49:49Z</updated>

		<summary type="html">&lt;p&gt;Stevehurcombe: Implementation feedback&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==general remarks about OUTPUT of operations:==&lt;br /&gt;
Is true of false informative enough ?&lt;br /&gt;
Should the API have some sort of &amp;quot;last_error&amp;quot; function giving back more details such as &amp;quot;non existing course, non existing user, duplicate entry ...)&lt;br /&gt;
Shall we consider that affecting a role that already exist or removing role that do not exist as an error (output=false) or not (output=true)&lt;br /&gt;
:yep, agree, I&#039;d result always one well defined $result object, with his status, error code and error msg (and perhaps, the whole original WS request encapsulated for easier debugging).&lt;br /&gt;
:[[User:Eloy Lafuente (stronk7)|Eloy Lafuente (stronk7)]] 19:55, 21 December 2007 (CST)&lt;br /&gt;
I agree but throught the WS we need to be  be carefull with the feedback we give to errors, due to security issues. --[[User:Ludo (Marc Alier)|Ludo (Marc Alier)]] 14:14, 22 December 2007 (CST)&lt;br /&gt;
&lt;br /&gt;
==some WS to be able to... build courses ?==&lt;br /&gt;
Perhpas it would be a great idea to start thinking about some WS functionalities like this:&lt;br /&gt;
&lt;br /&gt;
* add_course, delete_course, reset_course&lt;br /&gt;
* add_section, delete_section, show_section, hide_section&lt;br /&gt;
* add_activity, delete_activity, show_activity, hide_activity&lt;br /&gt;
&lt;br /&gt;
Apart from the WS utility itself: automated creation of courses... it would help (or force, as we prefer), to better encapsulate course/section/modules internals, 100% isolating the creation and configuration from the frontend (forms, WS...). It implies some decisions, like upwards compatibility of old modules (although I think it can be maintained)... and so on, you know.&lt;br /&gt;
&lt;br /&gt;
Just one idea to analyse. But with benefits in the end, IMO.&lt;br /&gt;
[[User:Eloy Lafuente (stronk7)|Eloy Lafuente (stronk7)]] 20:02, 21 December 2007 (CST)&lt;br /&gt;
&lt;br /&gt;
I do agree with this ; this would also allow creation of specific courses, customized for some users, depending of their &amp;quot;performances&amp;quot; in external evaluations methods ; when the ePortfolio API will be finalized in Moodle core&#039;s, accessing the portfolio of any user would be  needed.&lt;br /&gt;
[[User:Patrick Pollet|Patrick Pollet]] 04:21, 30 December 2007 (CST)&lt;br /&gt;
&lt;br /&gt;
==the problem of ID of entity to fetch:==&lt;br /&gt;
In the list of API calls defined in this page, Moodle entity to process (user,course,grade,event ...) is identified by an ID, that is implicitly the Moodle&#039;s internal id field used in the database. This raises a problem since it is very likely that in the &amp;quot;external SIS&amp;quot; talking to Moodle across the Web Service, the entity will be identified by another attribute such as an idNumber (user,course), a short name (course) or even an username (login of user). &lt;br /&gt;
&lt;br /&gt;
So either we must provide :&lt;br /&gt;
&lt;br /&gt;
* extra API calls to convert external identifiers to Moodle&#039;s internal id, such as user_id_from_idnumber, user_id_from_username, course_id_from_shortname ..., at the cost of extra calls   before the real one ; three calls would be needed to enrol student &amp;quot;CS2121212&amp;quot;, to course &amp;quot;JAVA_101&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
* extra API functions such as delete_user_byusername, get_course_by_idnumber , enrol_student_byidnumber_tocourse_byshortname ....&lt;br /&gt;
&lt;br /&gt;
* or add parameters to the current API calls specifiying what identifier we are using  such as delete_user(id,idField) with idField being a string that could be &amp;quot;id&amp;quot;,&amp;quot;idnumber&amp;quot;,&amp;quot;username&amp;quot;,&amp;quot;email&amp;quot; ... or enrol_student(sid,&amp;quot;idnumber&amp;quot;,cid,&amp;quot;shortname&amp;quot;) . This is the approach in the current SOAP implementation (with some calls of the previous type (get_user_byusername()...)   &lt;br /&gt;
&lt;br /&gt;
[[User:Patrick Pollet|Patrick Pollet]] 04:21, 30 December 2007 (CST)&lt;br /&gt;
&lt;br /&gt;
== output of operations: adding URLs?==&lt;br /&gt;
In addition, I suggest to return the full URL towards every Moodle entity, either added or got.&lt;br /&gt;
* user added with id 12345 --&amp;gt; http://moodle.xxx.edu/user/view.php?id=12345&amp;amp;course=1&lt;br /&gt;
* got user 12345 --&amp;gt; http://moodle.xxx.edu/user/view.php?id=12345&amp;amp;course=1&lt;br /&gt;
* course added with id 67 --&amp;gt; http://moodle.xxx.edu/course/view.php?id=67&lt;br /&gt;
* got course 67 --&amp;gt; http://moodle.xxx.edu/course/view.php?id=67&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
Today, in my uPortal installation, I request for Moodle database and display a list of courses in which the connected user is enrolled. Of course I provide links to these courses so that he can directly access. In addition I display a list of the last changes in these courses, again with links to the resources/activities.&lt;br /&gt;
&lt;br /&gt;
If the URLs are returned by the WS then the calling service has nothing to know about Moodle URLs. Else it has to build every URL by aggregating Moodle alias + adequate PHP script + entity ID&lt;br /&gt;
&lt;br /&gt;
== Implementation feedback ==&lt;br /&gt;
&lt;br /&gt;
[Feedback]&lt;br /&gt;
Speaking as someone who will be using this API to integrate with another line of business application I would recommend the following changes.&lt;br /&gt;
&lt;br /&gt;
The add_user method should really be a &#039;SetUser&#039; ie it will create the record if it does not exist or update it it if it does. The ID that is passed into the method would be *our* primary key which Moodle would use to recognise the user record within Moodle. We would not normally need to know anything about the Moodle primary key.&lt;br /&gt;
&lt;br /&gt;
One option to make the web services maintainable is to accept XML as a parameter and not a structure or custom object. That way you can define an XSD which will define required\optional parameters. Equally if you include a version number you can change the XML to add new features without having to redefine the web service signature itself (and hence clients will not have to recompile their code). So you may receive a SetUser call with XML V1.0 and another with XML V2.0 on the same webservice but from two different clients supporting different versions of the API.&lt;br /&gt;
&lt;br /&gt;
The method *must* accept an array of users - it&#039;s a little trickier to set this up in the client code but is much more scalable (if there&#039;s some good sample code then this is easier anyway). The latency (round trip time) with web service calls is high so you want to do as much as you can in a single call. We have a customer who wants us to deploy Moodle to 40,000 users - we&#039;re not going to do that using individual calls.&lt;br /&gt;
&lt;br /&gt;
Would it be possible to expand on the existing web service work rather than produce something completely new? We&#039;re investing a lot of effort with these services and we wouldn&#039;t like to have to re-do that work.&lt;br /&gt;
[/Feedback]&lt;/div&gt;</summary>
		<author><name>Stevehurcombe</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Web_services&amp;diff=31307</id>
		<title>Development:Web services</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Web_services&amp;diff=31307"/>
		<updated>2008-01-15T15:49:04Z</updated>

		<summary type="html">&lt;p&gt;Stevehurcombe: /* add user */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is to decide on a STANDARD list of CORE web service functions that we should support in Moodle (by XMLRPC, REST and SOAP with the option to plug in AMFPHP for Flash/Flex interfaces) as an API for those writing code to work against Moodle.&lt;br /&gt;
&lt;br /&gt;
Please add new functions if there&#039;s functionality you want that isn&#039;t covered (we can refactor/whittle at the end).&lt;br /&gt;
&lt;br /&gt;
The tracker bug for all this is here: MDL-12886&lt;br /&gt;
&lt;br /&gt;
==add user==&lt;br /&gt;
I think we should require all data needed for a successful &amp;quot;first login&amp;quot; to Moodle without popping him out the profile page to fill in all missing required data. This may require extra inputs such as city, description ... (unsure of the full list depending of Moodle version ?).&lt;br /&gt;
Also password should be &amp;quot;required&amp;quot; if authentication method is &amp;quot;internal&amp;quot; . &lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
    firstname&lt;br /&gt;
    lastname&lt;br /&gt;
    email &lt;br /&gt;
    idnumber&lt;br /&gt;
    login &lt;br /&gt;
    authentication method (optional , default= manual ?)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Adds a new user to the user database &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    id or false&lt;br /&gt;
&lt;br /&gt;
==delete user==&lt;br /&gt;
INPUT:&lt;br /&gt;
    idnumber  or &lt;br /&gt;
    email or &lt;br /&gt;
    id or&lt;br /&gt;
    login&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    User is marked as deleted&lt;br /&gt;
    All it&#039;s role assignments are destroyed &lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true/false&lt;br /&gt;
&lt;br /&gt;
==get user==&lt;br /&gt;
INPUT:&lt;br /&gt;
    idnumber  or &lt;br /&gt;
    email or &lt;br /&gt;
    id or&lt;br /&gt;
    login&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    user record with optional fields set (Moodle 1.8 and later) and maybe some fields filtered out (password, &lt;br /&gt;
    email if user said not to disclose it ...) depending of the identity of the &amp;quot;caller&amp;quot; (admin or the user himself) &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    false  or user record&lt;br /&gt;
&lt;br /&gt;
==add course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    name&lt;br /&gt;
    shortname&lt;br /&gt;
    format (default topics)&lt;br /&gt;
    idnumber &lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Adds a new course to the course table&lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    id or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==delete course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    name OR&lt;br /&gt;
    shortname  OR&lt;br /&gt;
    idnumber OR&lt;br /&gt;
    id&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Deletes a course from the course table&lt;br /&gt;
    What about associated ressources, roles ... &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    id or  idnumber or shortname&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
     fetch course record with some fields filtered out depending of the &amp;quot;caller&amp;quot; identity (admin, teacher, student ...)&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    false  or course record&lt;br /&gt;
&lt;br /&gt;
==enrol student to course==&lt;br /&gt;
[Feedback]&lt;br /&gt;
It&#039;s not clear what the difference is or significance of ID vs. idnumber is. Remember the web service developers will probably not be users of Moodle so it needs to be clear.&lt;br /&gt;
[/Feedback]&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
    course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
    student unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Assign student role to course &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
==unenrol student from course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
    student unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    remove student role from course &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==assign role to course==&lt;br /&gt;
INPUT:&lt;br /&gt;
   course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   role id (teacher, non editing teacher, student (?) ...)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   assign given user a &amp;quot;standard&amp;quot; role to given course   &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==remove role from course==&lt;br /&gt;
INPUT:&lt;br /&gt;
   course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   role id (teacher, non editing teacher, student (?) ...)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   remove given user&#039;s &amp;quot;standard&amp;quot; role from given course   &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get my courses==&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of course&#039;s id in which given user move given user has some role assigned     &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    &amp;quot;array&amp;quot; of (course id, course shortname, course fullname, role id, role name, course url)&lt;br /&gt;
    or false in case of error (bad user id)&lt;br /&gt;
&lt;br /&gt;
==get last changes in my courses==&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   course unique Id (Moodle&#039;s ID ,idnumber or shortname) - optional (default = all my courses)&lt;br /&gt;
   timestamp - optional (default = time of last connexion in every course)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of changes (resource added/modified, new activities, etc.) for courses in which given user has some role assigned - since timestamp or last connexion in given course &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    &amp;quot;array&amp;quot; of (course id, course shortname, course fullname, role id, role name, url of the resource/activity, time of change)&lt;br /&gt;
    or false in case of error (bad user/course id)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get grades==&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   course unique Id (Moodle&#039;s ID ,idnumber or shortname) - optional (default = all my courses)&lt;br /&gt;
   &lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of grades and statistics for the given student in the given course&lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    &amp;quot;array&amp;quot; of grades records (name,maxgrade,grade,percent,weight,weighted,sortOrder) &lt;br /&gt;
    and &amp;quot;array&amp;quot; of stats (gradeItems,allgrades, points,totalpoints, percent, weight, weighted;)  &lt;br /&gt;
    or false in case of error (bad user/course id or user not in course)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get groups==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of group records in a given course (or site ?) &lt;br /&gt;
&lt;br /&gt;
==get group members==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of ids  for members of a group (within a course or global) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==enrol to group==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   add a new member to a group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==unenrol from group==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   remove membership from a group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get calendar events ==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of event&#039;s identifiers suitable from the &amp;quot;get event&amp;quot; operation&lt;br /&gt;
&lt;br /&gt;
==get calendar event==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return in an &amp;quot;exportable&amp;quot; format (iCal, vCal ...)an event recorded in Moodle database (site, course, private ...)&lt;br /&gt;
&lt;br /&gt;
==set calendar event==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   add/modify an event in Moodle database (site, course, private ...)&lt;/div&gt;</summary>
		<author><name>Stevehurcombe</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Web_services&amp;diff=31306</id>
		<title>Development:Web services</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Web_services&amp;diff=31306"/>
		<updated>2008-01-15T15:47:34Z</updated>

		<summary type="html">&lt;p&gt;Stevehurcombe: /* add user */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is to decide on a STANDARD list of CORE web service functions that we should support in Moodle (by XMLRPC, REST and SOAP with the option to plug in AMFPHP for Flash/Flex interfaces) as an API for those writing code to work against Moodle.&lt;br /&gt;
&lt;br /&gt;
Please add new functions if there&#039;s functionality you want that isn&#039;t covered (we can refactor/whittle at the end).&lt;br /&gt;
&lt;br /&gt;
The tracker bug for all this is here: MDL-12886&lt;br /&gt;
&lt;br /&gt;
==add user==&lt;br /&gt;
[Feedback]&lt;br /&gt;
Speaking as someone who will be using this API to integrate with another line of business application I would recommend the following changes.&lt;br /&gt;
&lt;br /&gt;
The add_user method should really be a &#039;SetUser&#039; ie it will create the record if it does not exist or update it it if it does. The ID that is passed into the method would be *our* primary key which Moodle would use to recognise the user record within Moodle. We would not normally need to know anything about the Moodle primary key.&lt;br /&gt;
&lt;br /&gt;
One option to make the web services maintainable is to accept XML as a parameter and not a structure or custom object. That way you can define an XSD which will define required\optional parameters. Equally if you include a version number you can change the XML to add new features without having to redefine the web service signature itself (and hence clients will not have to recompile their code). So you may receive a SetUser call with XML V1.0 and another with XML V2.0 on the same webservice but from two different clients supporting different versions of the API.&lt;br /&gt;
&lt;br /&gt;
The method *must* accept an array of users - it&#039;s a little trickier to set this up in the client code but is much more scalable (if there&#039;s some good sample code then this is easier anyway). The latency (round trip time) with web service calls is high so you want to do as much as you can in a single call. We have a customer who wants us to deploy Moodle to 40,000 users - we&#039;re not going to do that using individual calls.&lt;br /&gt;
&lt;br /&gt;
Would it be possible to expand on the existing web service work rather than produce something completely new? We&#039;re investing a lot of effort with these services and we wouldn&#039;t like to have to re-do that work.&lt;br /&gt;
[/Feedback]&lt;br /&gt;
&lt;br /&gt;
I think we should require all data needed for a successful &amp;quot;first login&amp;quot; to Moodle without popping him out the profile page to fill in all missing required data. This may require extra inputs such as city, description ... (unsure of the full list depending of Moodle version ?).&lt;br /&gt;
Also password should be &amp;quot;required&amp;quot; if authentication method is &amp;quot;internal&amp;quot; . &lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
    firstname&lt;br /&gt;
    lastname&lt;br /&gt;
    email &lt;br /&gt;
    idnumber&lt;br /&gt;
    login &lt;br /&gt;
    authentication method (optional , default= manual ?)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Adds a new user to the user database &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    id or false&lt;br /&gt;
&lt;br /&gt;
==delete user==&lt;br /&gt;
INPUT:&lt;br /&gt;
    idnumber  or &lt;br /&gt;
    email or &lt;br /&gt;
    id or&lt;br /&gt;
    login&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    User is marked as deleted&lt;br /&gt;
    All it&#039;s role assignments are destroyed &lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true/false&lt;br /&gt;
&lt;br /&gt;
==get user==&lt;br /&gt;
INPUT:&lt;br /&gt;
    idnumber  or &lt;br /&gt;
    email or &lt;br /&gt;
    id or&lt;br /&gt;
    login&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    user record with optional fields set (Moodle 1.8 and later) and maybe some fields filtered out (password, &lt;br /&gt;
    email if user said not to disclose it ...) depending of the identity of the &amp;quot;caller&amp;quot; (admin or the user himself) &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    false  or user record&lt;br /&gt;
&lt;br /&gt;
==add course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    name&lt;br /&gt;
    shortname&lt;br /&gt;
    format (default topics)&lt;br /&gt;
    idnumber &lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Adds a new course to the course table&lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    id or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==delete course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    name OR&lt;br /&gt;
    shortname  OR&lt;br /&gt;
    idnumber OR&lt;br /&gt;
    id&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Deletes a course from the course table&lt;br /&gt;
    What about associated ressources, roles ... &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    id or  idnumber or shortname&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
     fetch course record with some fields filtered out depending of the &amp;quot;caller&amp;quot; identity (admin, teacher, student ...)&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    false  or course record&lt;br /&gt;
&lt;br /&gt;
==enrol student to course==&lt;br /&gt;
[Feedback]&lt;br /&gt;
It&#039;s not clear what the difference is or significance of ID vs. idnumber is. Remember the web service developers will probably not be users of Moodle so it needs to be clear.&lt;br /&gt;
[/Feedback]&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
    course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
    student unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Assign student role to course &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
==unenrol student from course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
    student unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    remove student role from course &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==assign role to course==&lt;br /&gt;
INPUT:&lt;br /&gt;
   course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   role id (teacher, non editing teacher, student (?) ...)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   assign given user a &amp;quot;standard&amp;quot; role to given course   &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==remove role from course==&lt;br /&gt;
INPUT:&lt;br /&gt;
   course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   role id (teacher, non editing teacher, student (?) ...)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   remove given user&#039;s &amp;quot;standard&amp;quot; role from given course   &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get my courses==&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of course&#039;s id in which given user move given user has some role assigned     &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    &amp;quot;array&amp;quot; of (course id, course shortname, course fullname, role id, role name, course url)&lt;br /&gt;
    or false in case of error (bad user id)&lt;br /&gt;
&lt;br /&gt;
==get last changes in my courses==&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   course unique Id (Moodle&#039;s ID ,idnumber or shortname) - optional (default = all my courses)&lt;br /&gt;
   timestamp - optional (default = time of last connexion in every course)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of changes (resource added/modified, new activities, etc.) for courses in which given user has some role assigned - since timestamp or last connexion in given course &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    &amp;quot;array&amp;quot; of (course id, course shortname, course fullname, role id, role name, url of the resource/activity, time of change)&lt;br /&gt;
    or false in case of error (bad user/course id)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get grades==&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   course unique Id (Moodle&#039;s ID ,idnumber or shortname) - optional (default = all my courses)&lt;br /&gt;
   &lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of grades and statistics for the given student in the given course&lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    &amp;quot;array&amp;quot; of grades records (name,maxgrade,grade,percent,weight,weighted,sortOrder) &lt;br /&gt;
    and &amp;quot;array&amp;quot; of stats (gradeItems,allgrades, points,totalpoints, percent, weight, weighted;)  &lt;br /&gt;
    or false in case of error (bad user/course id or user not in course)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get groups==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of group records in a given course (or site ?) &lt;br /&gt;
&lt;br /&gt;
==get group members==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of ids  for members of a group (within a course or global) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==enrol to group==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   add a new member to a group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==unenrol from group==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   remove membership from a group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get calendar events ==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of event&#039;s identifiers suitable from the &amp;quot;get event&amp;quot; operation&lt;br /&gt;
&lt;br /&gt;
==get calendar event==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return in an &amp;quot;exportable&amp;quot; format (iCal, vCal ...)an event recorded in Moodle database (site, course, private ...)&lt;br /&gt;
&lt;br /&gt;
==set calendar event==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   add/modify an event in Moodle database (site, course, private ...)&lt;/div&gt;</summary>
		<author><name>Stevehurcombe</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Web_services&amp;diff=31305</id>
		<title>Development:Web services</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Web_services&amp;diff=31305"/>
		<updated>2008-01-15T15:40:18Z</updated>

		<summary type="html">&lt;p&gt;Stevehurcombe: /* enrol student to course */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is to decide on a STANDARD list of CORE web service functions that we should support in Moodle (by XMLRPC, REST and SOAP with the option to plug in AMFPHP for Flash/Flex interfaces) as an API for those writing code to work against Moodle.&lt;br /&gt;
&lt;br /&gt;
Please add new functions if there&#039;s functionality you want that isn&#039;t covered (we can refactor/whittle at the end).&lt;br /&gt;
&lt;br /&gt;
The tracker bug for all this is here: MDL-12886&lt;br /&gt;
&lt;br /&gt;
==add user==&lt;br /&gt;
[Feedback]&lt;br /&gt;
Speaking as someone who will be using this API to integrate with another line of business application I would recommend the following changes.&lt;br /&gt;
&lt;br /&gt;
The add_user method should really be a &#039;SetUser&#039; ie it will create the record if it does not exist or update it it if it does. The ID that is passed into the method would be *our* primary key which Moodle would use to recognise the user record within Moodle. We would not normally need to know anything about the Moodle primary key.&lt;br /&gt;
&lt;br /&gt;
One option to make the web services maintainable is to accept XML as a parameter and not a structure or custom object. That way you can define an XSD which will define required\optional parameters. Equally if you include a version number you can change the XML to add new features without having to redefine the web service signature itself (and hence clients will not have to recompile their code). So you may receive a SetUser call with XML V1.0 and another with XML V2.0 on the same webservice but from two different clients supporting different versions of the API.&lt;br /&gt;
&lt;br /&gt;
The method *must* accept an array of users - it&#039;s a little trickier to set this up in the client code but is much more scalable (if there&#039;s some good sample code then this is easier anyway). The latency (round trip time) with web service calls is high so you want to do as much as you can in a single call. We have a customer who wants us to deploy Moodle to 40,000 users - we&#039;re not going to do that using individual calls.&lt;br /&gt;
[/Feedback]&lt;br /&gt;
&lt;br /&gt;
I think we should require all data needed for a successful &amp;quot;first login&amp;quot; to Moodle without popping him out the profile page to fill in all missing required data. This may require extra inputs such as city, description ... (unsure of the full list depending of Moodle version ?).&lt;br /&gt;
Also password should be &amp;quot;required&amp;quot; if authentication method is &amp;quot;internal&amp;quot; . &lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
    firstname&lt;br /&gt;
    lastname&lt;br /&gt;
    email &lt;br /&gt;
    idnumber&lt;br /&gt;
    login &lt;br /&gt;
    authentication method (optional , default= manual ?)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Adds a new user to the user database &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    id or false&lt;br /&gt;
&lt;br /&gt;
==delete user==&lt;br /&gt;
INPUT:&lt;br /&gt;
    idnumber  or &lt;br /&gt;
    email or &lt;br /&gt;
    id or&lt;br /&gt;
    login&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    User is marked as deleted&lt;br /&gt;
    All it&#039;s role assignments are destroyed &lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true/false&lt;br /&gt;
&lt;br /&gt;
==get user==&lt;br /&gt;
INPUT:&lt;br /&gt;
    idnumber  or &lt;br /&gt;
    email or &lt;br /&gt;
    id or&lt;br /&gt;
    login&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    user record with optional fields set (Moodle 1.8 and later) and maybe some fields filtered out (password, &lt;br /&gt;
    email if user said not to disclose it ...) depending of the identity of the &amp;quot;caller&amp;quot; (admin or the user himself) &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    false  or user record&lt;br /&gt;
&lt;br /&gt;
==add course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    name&lt;br /&gt;
    shortname&lt;br /&gt;
    format (default topics)&lt;br /&gt;
    idnumber &lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Adds a new course to the course table&lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    id or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==delete course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    name OR&lt;br /&gt;
    shortname  OR&lt;br /&gt;
    idnumber OR&lt;br /&gt;
    id&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Deletes a course from the course table&lt;br /&gt;
    What about associated ressources, roles ... &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    id or  idnumber or shortname&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
     fetch course record with some fields filtered out depending of the &amp;quot;caller&amp;quot; identity (admin, teacher, student ...)&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    false  or course record&lt;br /&gt;
&lt;br /&gt;
==enrol student to course==&lt;br /&gt;
[Feedback]&lt;br /&gt;
It&#039;s not clear what the difference is or significance of ID vs. idnumber is. Remember the web service developers will probably not be users of Moodle so it needs to be clear.&lt;br /&gt;
[/Feedback]&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
    course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
    student unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Assign student role to course &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
==unenrol student from course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
    student unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    remove student role from course &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==assign role to course==&lt;br /&gt;
INPUT:&lt;br /&gt;
   course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   role id (teacher, non editing teacher, student (?) ...)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   assign given user a &amp;quot;standard&amp;quot; role to given course   &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==remove role from course==&lt;br /&gt;
INPUT:&lt;br /&gt;
   course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   role id (teacher, non editing teacher, student (?) ...)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   remove given user&#039;s &amp;quot;standard&amp;quot; role from given course   &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get my courses==&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of course&#039;s id in which given user move given user has some role assigned     &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    &amp;quot;array&amp;quot; of (course id, course shortname, course fullname, role id, role name, course url)&lt;br /&gt;
    or false in case of error (bad user id)&lt;br /&gt;
&lt;br /&gt;
==get last changes in my courses==&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   course unique Id (Moodle&#039;s ID ,idnumber or shortname) - optional (default = all my courses)&lt;br /&gt;
   timestamp - optional (default = time of last connexion in every course)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of changes (resource added/modified, new activities, etc.) for courses in which given user has some role assigned - since timestamp or last connexion in given course &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    &amp;quot;array&amp;quot; of (course id, course shortname, course fullname, role id, role name, url of the resource/activity, time of change)&lt;br /&gt;
    or false in case of error (bad user/course id)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get grades==&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   course unique Id (Moodle&#039;s ID ,idnumber or shortname) - optional (default = all my courses)&lt;br /&gt;
   &lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of grades and statistics for the given student in the given course&lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    &amp;quot;array&amp;quot; of grades records (name,maxgrade,grade,percent,weight,weighted,sortOrder) &lt;br /&gt;
    and &amp;quot;array&amp;quot; of stats (gradeItems,allgrades, points,totalpoints, percent, weight, weighted;)  &lt;br /&gt;
    or false in case of error (bad user/course id or user not in course)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get groups==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of group records in a given course (or site ?) &lt;br /&gt;
&lt;br /&gt;
==get group members==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of ids  for members of a group (within a course or global) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==enrol to group==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   add a new member to a group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==unenrol from group==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   remove membership from a group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get calendar events ==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of event&#039;s identifiers suitable from the &amp;quot;get event&amp;quot; operation&lt;br /&gt;
&lt;br /&gt;
==get calendar event==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return in an &amp;quot;exportable&amp;quot; format (iCal, vCal ...)an event recorded in Moodle database (site, course, private ...)&lt;br /&gt;
&lt;br /&gt;
==set calendar event==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   add/modify an event in Moodle database (site, course, private ...)&lt;/div&gt;</summary>
		<author><name>Stevehurcombe</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Web_services&amp;diff=31304</id>
		<title>Development:Web services</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Web_services&amp;diff=31304"/>
		<updated>2008-01-15T15:38:30Z</updated>

		<summary type="html">&lt;p&gt;Stevehurcombe: /* add user */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is to decide on a STANDARD list of CORE web service functions that we should support in Moodle (by XMLRPC, REST and SOAP with the option to plug in AMFPHP for Flash/Flex interfaces) as an API for those writing code to work against Moodle.&lt;br /&gt;
&lt;br /&gt;
Please add new functions if there&#039;s functionality you want that isn&#039;t covered (we can refactor/whittle at the end).&lt;br /&gt;
&lt;br /&gt;
The tracker bug for all this is here: MDL-12886&lt;br /&gt;
&lt;br /&gt;
==add user==&lt;br /&gt;
[Feedback]&lt;br /&gt;
Speaking as someone who will be using this API to integrate with another line of business application I would recommend the following changes.&lt;br /&gt;
&lt;br /&gt;
The add_user method should really be a &#039;SetUser&#039; ie it will create the record if it does not exist or update it it if it does. The ID that is passed into the method would be *our* primary key which Moodle would use to recognise the user record within Moodle. We would not normally need to know anything about the Moodle primary key.&lt;br /&gt;
&lt;br /&gt;
One option to make the web services maintainable is to accept XML as a parameter and not a structure or custom object. That way you can define an XSD which will define required\optional parameters. Equally if you include a version number you can change the XML to add new features without having to redefine the web service signature itself (and hence clients will not have to recompile their code). So you may receive a SetUser call with XML V1.0 and another with XML V2.0 on the same webservice but from two different clients supporting different versions of the API.&lt;br /&gt;
&lt;br /&gt;
The method *must* accept an array of users - it&#039;s a little trickier to set this up in the client code but is much more scalable (if there&#039;s some good sample code then this is easier anyway). The latency (round trip time) with web service calls is high so you want to do as much as you can in a single call. We have a customer who wants us to deploy Moodle to 40,000 users - we&#039;re not going to do that using individual calls.&lt;br /&gt;
[/Feedback]&lt;br /&gt;
&lt;br /&gt;
I think we should require all data needed for a successful &amp;quot;first login&amp;quot; to Moodle without popping him out the profile page to fill in all missing required data. This may require extra inputs such as city, description ... (unsure of the full list depending of Moodle version ?).&lt;br /&gt;
Also password should be &amp;quot;required&amp;quot; if authentication method is &amp;quot;internal&amp;quot; . &lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
    firstname&lt;br /&gt;
    lastname&lt;br /&gt;
    email &lt;br /&gt;
    idnumber&lt;br /&gt;
    login &lt;br /&gt;
    authentication method (optional , default= manual ?)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Adds a new user to the user database &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    id or false&lt;br /&gt;
&lt;br /&gt;
==delete user==&lt;br /&gt;
INPUT:&lt;br /&gt;
    idnumber  or &lt;br /&gt;
    email or &lt;br /&gt;
    id or&lt;br /&gt;
    login&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    User is marked as deleted&lt;br /&gt;
    All it&#039;s role assignments are destroyed &lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true/false&lt;br /&gt;
&lt;br /&gt;
==get user==&lt;br /&gt;
INPUT:&lt;br /&gt;
    idnumber  or &lt;br /&gt;
    email or &lt;br /&gt;
    id or&lt;br /&gt;
    login&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    user record with optional fields set (Moodle 1.8 and later) and maybe some fields filtered out (password, &lt;br /&gt;
    email if user said not to disclose it ...) depending of the identity of the &amp;quot;caller&amp;quot; (admin or the user himself) &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    false  or user record&lt;br /&gt;
&lt;br /&gt;
==add course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    name&lt;br /&gt;
    shortname&lt;br /&gt;
    format (default topics)&lt;br /&gt;
    idnumber &lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Adds a new course to the course table&lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    id or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==delete course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    name OR&lt;br /&gt;
    shortname  OR&lt;br /&gt;
    idnumber OR&lt;br /&gt;
    id&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Deletes a course from the course table&lt;br /&gt;
    What about associated ressources, roles ... &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    id or  idnumber or shortname&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
     fetch course record with some fields filtered out depending of the &amp;quot;caller&amp;quot; identity (admin, teacher, student ...)&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    false  or course record&lt;br /&gt;
&lt;br /&gt;
==enrol student to course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
    student unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    Assign student role to course &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==unenrol student from course==&lt;br /&gt;
INPUT:&lt;br /&gt;
    course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
    student unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
    remove student role from course &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==assign role to course==&lt;br /&gt;
INPUT:&lt;br /&gt;
   course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   role id (teacher, non editing teacher, student (?) ...)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   assign given user a &amp;quot;standard&amp;quot; role to given course   &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==remove role from course==&lt;br /&gt;
INPUT:&lt;br /&gt;
   course unique Id (Moodle&#039;s ID or idnumber or shortname)&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   role id (teacher, non editing teacher, student (?) ...)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   remove given user&#039;s &amp;quot;standard&amp;quot; role from given course   &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    true or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get my courses==&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of course&#039;s id in which given user move given user has some role assigned     &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    &amp;quot;array&amp;quot; of (course id, course shortname, course fullname, role id, role name, course url)&lt;br /&gt;
    or false in case of error (bad user id)&lt;br /&gt;
&lt;br /&gt;
==get last changes in my courses==&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   course unique Id (Moodle&#039;s ID ,idnumber or shortname) - optional (default = all my courses)&lt;br /&gt;
   timestamp - optional (default = time of last connexion in every course)&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of changes (resource added/modified, new activities, etc.) for courses in which given user has some role assigned - since timestamp or last connexion in given course &lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    &amp;quot;array&amp;quot; of (course id, course shortname, course fullname, role id, role name, url of the resource/activity, time of change)&lt;br /&gt;
    or false in case of error (bad user/course id)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get grades==&lt;br /&gt;
&lt;br /&gt;
INPUT:&lt;br /&gt;
   user unique id (Moodle&#039;s ID or idnumber or login or email)&lt;br /&gt;
   course unique Id (Moodle&#039;s ID ,idnumber or shortname) - optional (default = all my courses)&lt;br /&gt;
   &lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of grades and statistics for the given student in the given course&lt;br /&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
    &amp;quot;array&amp;quot; of grades records (name,maxgrade,grade,percent,weight,weighted,sortOrder) &lt;br /&gt;
    and &amp;quot;array&amp;quot; of stats (gradeItems,allgrades, points,totalpoints, percent, weight, weighted;)  &lt;br /&gt;
    or false in case of error (bad user/course id or user not in course)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get groups==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of group records in a given course (or site ?) &lt;br /&gt;
&lt;br /&gt;
==get group members==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of ids  for members of a group (within a course or global) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==enrol to group==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   add a new member to a group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==unenrol from group==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   remove membership from a group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==get calendar events ==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return a &amp;quot;list&amp;quot; of event&#039;s identifiers suitable from the &amp;quot;get event&amp;quot; operation&lt;br /&gt;
&lt;br /&gt;
==get calendar event==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   return in an &amp;quot;exportable&amp;quot; format (iCal, vCal ...)an event recorded in Moodle database (site, course, private ...)&lt;br /&gt;
&lt;br /&gt;
==set calendar event==&lt;br /&gt;
&lt;br /&gt;
OPERATION:&lt;br /&gt;
   add/modify an event in Moodle database (site, course, private ...)&lt;/div&gt;</summary>
		<author><name>Stevehurcombe</name></author>
	</entry>
</feed>