Web service URL and parameters

Web service URL and parameters

by Pierre Le Bras -
Number of replies: 2

Hello,

I need to use this web Service: core_group_get_course_user_groups with URL but I don’t know how to add parameters

I think is something like that:

https://server.php?wstoken=token&wsfunction=core_group_get_course_user_groups&moodlewsrestformat=json&criteria[0][key]=courseid&criteria[0][value]=770&criteria[1][key]=userid&criteria[1][value]=5

but it doesn’t work, I have the error « invalid_parameter_exception »

could anyone help me?

thanks


Average of ratings: -
In reply to Pierre Le Bras

Re: Web service URL and parameters

by Pierre Le Bras -
It works for this first web service with parameters like that:
wsfunction=core_group_get_course_user_groups&moodlewsrestformat=json&courseid=15&userid=770

but now I need help for another web service smile

core_group_get_group_members
can I find on the net a list with web service AND parameters ?
Or if someone can tell me what are the parameters for this web service would be kind
Thanks
Pierre
In reply to Pierre Le Bras

Re: Web service URL and parameters

by Lawrence Lagerlof -

Tested on Moodle 3.4.2

function: core_group_get_group_members

Example:

http://YOUR_SERVER/moodle/webservice/rest/server.php?wstoken=YOUR_TOKEN&moodlewsrestformat=json&wsfunction=core_group_get_group_members&groupids[0]=1