Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Web service API functions

From MoodleDocs
Revision as of 09:06, 18 August 2011 by jerome mouneyrac (talk | contribs)

Moodle 2.0


Please add feedback on the talk page.

Draft

Color meaning
Implemented
Must be implemented
Suggested


Web service protocols

Name Moodle Ver. Description Issue
AMF 2.0 Adobe protocol to communicate with Flash/Flex apps
REST (returning XML) 2.0 XML data accessed through a restful API
REST (returning JSON) 2.X Would be very useful for client-side JavaScript
JSON 2.2 JSON server receives a JSON encoded params and return JSON encoded values. MDL-21341
SOAP 2.0 Very important for interoperating with Java and .Net applications. There was a partial implementation JAVA/.Net in Moodle 2.0, but it does not work for anything but the most trivial functions. It is fully working with PHP clients. MDL-20804
XMLRPC 2.0 XML remote-procedure call.

Web service functions

Naming convention

It was suggested during a chat meeting (18/08/11) that we could keep all the current web service names. However if the current web service name does not respect the naming convention we will create a new function. The "deprecated function" will have their description attribut indicating DEPRECATED. Both of the deprecated function and new function will be pointing to the same externallib.php function.

API Roadmap

Name Moodle Ver. Description Issue
User
moodle_user_create_users() 2.0 Create users - admin function
moodle_user_delete_users() 2.0 Delete users - admin function
moodle_user_update_users() 2.0 Update users
moodle_user_get_users_by_id() 2.0 Get users by id
moodle_user_get_course_participants_by_id() 2.1 Get course user profiles by id
moodle_user_get_users_by_courseid() 2.1 Get enrolled users by course id
moodle_user_get_users() 2.2 Get users from a specifed key/value MDL-27985
moodle_user_get_completed_users_per_course() 2.2 Get users who completed the course MDL-28320
moodle_user_get_completed_courses_per_user() 2.2 Get courses that a user completed MDL-28319
Course
moodle_course_get_courses() 2.0 Return course details
moodle_course_create_courses() 2.0 Create new courses
moodle_course_update_courses() 2.2 including moving categories
moodle_course_delete_courses() 2.2 MDL-13130
moodle_course_get_course_contents() 2.2 including sections, activities etc MDL-28646
moodle_course_get_recent_activity() 2.2 also works for site course MDL-13135
Group
moodle_group_create_groups() 2.0 Creates new groups
moodle_group_get_groups() 2.0 Returns group details.
moodle_group_get_course_groups() 2.0 Returns all groups in specified course
moodle_group_delete_groups() 2.0 Deletes all specified groups
moodle_group_get_groupmembers() 2.0 Returns group members
moodle_group_add_groupmembers() 2.0 Adds group members
moodle_group_delete_groupmembers() 2.0 Deletes group members
Role
moodle_role_assign() 2.0 Manual role assignments
moodle_role_unassign() 2.0 Manual role unassignments
Enrol
moodle_enrol_get_enrolled_users() 2.0 get some minimal information about the users enrolled in a course (DEPRECATED)
moodle_enrol_get_users_courses() 2.0 get list of course ids that a user is enrolled in (if you are allowed to see that)
Enrol/manual
moodle_enrol_manual_enrol_users() 2.0 Manual enrol users
moodle_enrol_manual_unenrol_users() 2.2 Manual unenrol users
moodle_enrol_ manual_update_enrolment() 2.2
Enrol/cohort
moodle_enrol_cohort_enrol_users() 2.2
moodle_enrol_cohort_unenrol_users() 2.2
Enrol/self
moodle_enrol_self_enrol_users() 2.2
moodle_enrol_self_unenrol_users() 2.2
Webservice
moodle_webservice_get_siteinfo() 2.1 Return some site info / user info / list web service functions
Message
moodle_message_send_instantmessages() 2.1 Send instant messages
moodle_message_get_instantmessages() 2.2 params for unread etc
moodle_message_create_contacts() 2.2
moodle_message_delete_contacts() 2.2
Notes
moodle_notes_create_notes() 2.1 Create notes
moodle_notes_delete_notes() 2.2
Events
moodle_event_create_event() 2.2 triggers an event
Calendar
moodle_calendar_create_events() 2.2
moodle_calendar_update_events() 2.2
moodle_calendar_delete_events() 2.2
Private file
moodle_file_get_files() 2.0 browse moodle files
moodle_file_upload() 2.0 upload a file to moodle (DEPRECATED)
moodle_file_create_files() 2.2 can also do folders via a flag
moodle_file_update_files() 2.2
moodle_file_delete_files() 2.2
Category
moodle_category_create_categories() 2.2
moodle_category_delete_categories() 2.2
moodle_category_update_categories() 2.2
moodle_category_get_categories() 2.2
Grade
moodle_grade_get_grades() 2.2 for user, course, activity etc
moodle_grade_get_scales() 2.2
moodle_grade_get_outcomes() 2.2
moodle_grade_update_grades() 2.2 including feedback
moodle_grade_create_grades() 2.2
Ratings
moodle_rating_get_ratings() 2.2
moodle_rating_create_ratings() 2.2
moodle_rating_update_ratings() 2.2
moodle_rating_delete_ratings() 2.2
Comments
moodle_comment_get_comments() 2.2
moodle_comment_create_comments() 2.2
moodle_comment_update_comments() 2.2
moodle_comment_delete_comments() 2.2
Forum
moodle_mod_forum_get_forums() 2.2
moodle_mod_forum_create_forums() 2.2
moodle_mod_forum_update_forums() 2.2
moodle_mod_forum_delete_forums() 2.2
moodle_mod_forum_get_discussions() 2.2
moodle_mod_forum_create_discussions() 2.2
moodle_mod_forum_update_discussions() 2.2
moodle_mod_forum_delete_discussions() 2.2
moodle_mod_forum_get_posts() 2.2
moodle_mod_forum_create_posts() 2.2
moodle_mod_forum_update_posts() 2.2
moodle_mod_forum_delete_posts() 2.2