General developer forum

Is there a webservice which will help me to get data from mdl_user_enrolments table

 
Picture of Baiju Sharma
Is there a webservice which will help me to get data from mdl_user_enrolments table
 

If I pass userid and courseid, the web services should return me timestart and timeend from mdl_user_enrolments table.I have tried to find web services which will return me these data, but no luck. Is there any web services which will help me to achieve this?If not what are the steps I have to follow to write web services?Where I have to write and store this files.I guess this will be my SQL queries.

SELECT 	ue.timestart,ue.timeend 
FROM
mdl_user_enrolments as ue
INNER JOIN mdl_enrol as en ON en.id=ue.enrolid
WHERE en.courseid=? AND ue.userid=?
 How will I convert these data into JSON format to send these data?
 
Average of ratings: -
Picture of Darko Miletić
Re: Is there a webservice which will help me to get data from mdl_user_enrolments table
Group Core developersGroup Particularly helpful Moodlers

If you need to know which users are enrolled in what courses you should use web service calls developed for core_enrol subsystem. You can find the list here

https://docs.moodle.org/dev/Web_service_API_functions

General information and additional links are located here

https://docs.moodle.org/dev/Web_services

 
Average of ratings: -
Picture of Baiju Sharma
Re: Is there a webservice which will help me to get data from mdl_user_enrolments table
 

Thank you for your reply.

I have checked web services, which you have suggested, but it is not giving me data which I required.

I need timestart and timeend from mdl_user_enrolments table where timestart is the date on which student has taken the course and timeend is the date on which, student enrollment period will get over. 

I have checked all web services given on https://docs.moodle.org/dev/Web_service_API_functions . I am surprised no web services return these data.


 
Average of ratings: -