Web services: Difference between revisions
(delete unenrol student from course) |
(Making things plural and tidying up) |
||
Line 5: | Line 5: | ||
The tracker bug for all this is here: MDL-12886 | The tracker bug for all this is here: MDL-12886 | ||
== | ==add_users== | ||
I think we should require all data needed for a successful "first login" 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 ?). | I think we should require all data needed for a successful "first login" 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 ?). | ||
Also password should be "required" if authentication method is "internal" . | Also password should be "required" if authentication method is "internal" . | ||
INPUT: | INPUT: | ||
one or more of these in an array | |||
firstname | firstname | ||
lastname | lastname | ||
Line 20: | Line 21: | ||
OPERATION: | OPERATION: | ||
Adds | Adds one or more new users to the user database | ||
OUTPUT: | OUTPUT: | ||
array of ids or false | |||
== | ==delete_users== | ||
INPUT: | INPUT: | ||
one or more of these in an array | |||
idnumber or | idnumber or | ||
email or | email or | ||
Line 38: | Line 40: | ||
true/false | true/false | ||
== | ==get_users== | ||
INPUT: | INPUT: | ||
one or more of these | |||
idnumber or | idnumber or | ||
email or | email or | ||
Line 52: | Line 55: | ||
false or user record | false or user record | ||
== | ==add_courses== | ||
INPUT: | INPUT: | ||
one or more of these in an array | |||
name | name | ||
shortname | shortname | ||
Line 66: | Line 70: | ||
== | ==delete_courses== | ||
INPUT: | INPUT: | ||
one or more of these in an array | |||
name OR | name OR | ||
shortname OR | shortname OR | ||
Line 74: | Line 79: | ||
OPERATION: | OPERATION: | ||
Deletes | Deletes courses from the course table | ||
What about associated ressources, roles ... | What about associated ressources, roles ... | ||
Line 81: | Line 86: | ||
== | ==get_courses== | ||
INPUT: | INPUT: | ||
one or more of these in an array | |||
id or idnumber or shortname | id or idnumber or shortname | ||
Line 88: | Line 94: | ||
fetch course record with some fields filtered out depending of the "caller" identity (admin, teacher, student ...) | fetch course record with some fields filtered out depending of the "caller" identity (admin, teacher, student ...) | ||
OUTPUT: | OUTPUT: | ||
false or course | false or course records in an array | ||
Line 96: | Line 102: | ||
==assign role to course== | ==assign role to course== | ||
INPUT: | INPUT: | ||
course unique Id (Moodle's ID or idnumber or shortname) | course unique Id (Moodle's ID or idnumber or shortname) (could be one or an array) | ||
user unique id (Moodle's ID or idnumber or login or email) | user unique id (Moodle's ID or idnumber or login or email) (could be one or an array) | ||
role id ( | role id (id or shortname or legacy capability name) (could be one or an array) | ||
OPERATION: | OPERATION: | ||
assign given user a | assign given user a given role to given course | ||
OUTPUT: | OUTPUT: | ||
Line 109: | Line 115: | ||
==remove role from course== | ==remove role from course== | ||
INPUT: | INPUT: | ||
course unique Id (Moodle's ID or idnumber or shortname) | course unique Id (Moodle's ID or idnumber or shortname) (could be one or an array) | ||
user unique id (Moodle's ID or idnumber or login or email) | user unique id (Moodle's ID or idnumber or login or email) (could be one or an array) | ||
role id (teacher, non editing teacher, student (?) ...) | role id (teacher, non editing teacher, student (?) ...) (could be one or an array) | ||
OPERATION: | OPERATION: | ||
Line 120: | Line 126: | ||
== | ==get_user_courses== | ||
INPUT: | INPUT: |
Revision as of 06:07, 24 January 2008
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.
Please add new functions if there's functionality you want that isn't covered (we can refactor/whittle at the end).
The tracker bug for all this is here: MDL-12886
add_users
I think we should require all data needed for a successful "first login" 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 ?). Also password should be "required" if authentication method is "internal" .
INPUT: one or more of these in an array
firstname lastname email idnumber login authentication method (optional , default= manual ?)
OPERATION:
Adds one or more new users to the user database
OUTPUT:
array of ids or false
delete_users
INPUT: one or more of these in an array
idnumber or email or id or login
OPERATION:
User is marked as deleted All it's role assignments are destroyed
OUTPUT:
true/false
get_users
INPUT: one or more of these
idnumber or email or id or login
OPERATION:
user record with optional fields set (Moodle 1.8 and later) and maybe some fields filtered out (password, email if user said not to disclose it ...) depending of the identity of the "caller" (admin or the user himself)
OUTPUT:
false or user record
add_courses
INPUT: one or more of these in an array
name shortname format (default topics) idnumber
OPERATION:
Adds a new course to the course table
OUTPUT:
id or false
delete_courses
INPUT: one or more of these in an array
name OR shortname OR idnumber OR id
OPERATION:
Deletes courses from the course table What about associated ressources, roles ...
OUTPUT:
true or false
get_courses
INPUT: one or more of these in an array
id or idnumber or shortname
OPERATION:
fetch course record with some fields filtered out depending of the "caller" identity (admin, teacher, student ...)
OUTPUT:
false or course records in an array
assign role to course
INPUT:
course unique Id (Moodle's ID or idnumber or shortname) (could be one or an array) user unique id (Moodle's ID or idnumber or login or email) (could be one or an array) role id (id or shortname or legacy capability name) (could be one or an array)
OPERATION:
assign given user a given role to given course
OUTPUT:
true or false
remove role from course
INPUT:
course unique Id (Moodle's ID or idnumber or shortname) (could be one or an array) user unique id (Moodle's ID or idnumber or login or email) (could be one or an array) role id (teacher, non editing teacher, student (?) ...) (could be one or an array)
OPERATION:
remove given user's "standard" role from given course
OUTPUT:
true or false
get_user_courses
INPUT:
user unique id (Moodle's ID or idnumber or login or email)
OPERATION:
return a "list" of course's id in which given user move given user has some role assigned
OUTPUT:
"array" of (course id, course shortname, course fullname, role id, role name, course url) or false in case of error (bad user id)
get last changes in my courses
INPUT:
user unique id (Moodle's ID or idnumber or login or email) course unique Id (Moodle's ID ,idnumber or shortname) - optional (default = all my courses) timestamp - optional (default = time of last connexion in every course)
OPERATION:
return a "list" 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
OUTPUT:
"array" of (course id, course shortname, course fullname, role id, role name, url of the resource/activity, time of change) or false in case of error (bad user/course id)
get grades
INPUT:
user unique id (Moodle's ID or idnumber or login or email) course unique Id (Moodle's ID ,idnumber or shortname) - optional (default = all my courses)
OPERATION:
return a "list" of grades and statistics for the given student in the given course
OUTPUT:
"array" of grades records (name,maxgrade,grade,percent,weight,weighted,sortOrder) and "array" of stats (gradeItems,allgrades, points,totalpoints, percent, weight, weighted;) or false in case of error (bad user/course id or user not in course)
get groups
OPERATION:
return a "list" of group records in a given course (or site ?)
get group members
OPERATION:
return a "list" of ids for members of a group (within a course or global)
enrol to group
OPERATION:
add a new member to a group
unenrol from group
OPERATION:
remove membership from a group
get calendar events
OPERATION:
return a "list" of event's identifiers suitable from the "get event" operation
get calendar event
OPERATION:
return in an "exportable" format (iCal, vCal ...)an event recorded in Moodle database (site, course, private ...)
set calendar event
OPERATION:
add/modify an event in Moodle database (site, course, private ...)