how to get all the trainers for a course in webservice api?

how to get all the trainers for a course in webservice api?

by Ankur Biswas -
Number of replies: 3
how to get all the trainers for a course in webservice api? Is there any built in web service function for this?


Average of ratings: -
In reply to Ankur Biswas

Re: how to get all the trainers for a course in webservice api?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I assume you are asking how to get a list of users with a particular role in a course. 

I would probably use 'core_enrol_get_enrolled_users_with_capability'. This returns an array of users with a particular capability in that course. This might really be what you want anyway (e.g., "those with the right to edit the course"). 

Average of ratings: Useful (1)
In reply to Howard Miller

Re: how to get all the trainers for a course in webservice api?

by Ankur Biswas -

it's okay.But how to send the arguments to this api?I have searched all but didn't get a perfect solution

In reply to Ankur Biswas

Re: how to get all the trainers for a course in webservice api?

by Ankur Biswas -

hi, after reading api documentation I have found the below format to be send as an argument.

REST (POST parameters)
coursecapabilities[0][courseid]= int coursecapabilities[0][capabilities][0]= string
I need to know what are the capabilities I should write by replacing 'string' in the above code.anybody help me with an example.Thanks in advance