I am go through the service module inside moodle , how can i add my own function and class for handling some operations such as enrolling and register . is it possible or not
Asked
Active
Viewed 1,410 times
3 Answers
1
You need to create a new plugin (probably a 'local' plugin) and add a webservice within it:
https://docs.moodle.org/dev/Adding_a_web_service_to_a_plugin

davosmith
- 6,037
- 2
- 14
- 23
-
I am created new service inside service module . created callback function inside corresponding class . inside the class file created function , parameters and its return function .Then i am accessing through the url it gives the error like {"exception":"dml_missing_record_exception","errorcode":"invalidrecord","message" :"Can not find data record in database table external_functions."} – Varun Sreedharan Aug 11 '16 at 05:22
0
this might help
https://docs.moodle.org/dev/Web_service_API_functions
even this--- https://docs.moodle.org/31/en/Using_web_services
-
1Nishil my question is about how to expand service.php inside moodle webservice section, I want to create new API for handling some sections in moodle , so is there any way to do this. Custom service creation or Custom API Creation – Varun Sreedharan Aug 10 '16 at 08:44
0
I created a new web service "core_completion_override_course_completion_status"
- Duplicate any existing web service and replace the words as per your need in the method name, class name etc.
Increate Moodle main version from version.php in root moodle folder.

Dharman
- 30,962
- 25
- 85
- 135