core_cohort_search_cohorts trouble with post in REST

Re: core_cohort_search_cohorts trouble with post in REST

by Mayank Tyagi -
Number of replies: 0
Hey Pierre,

As mentioned in the error "invalid_parameter_exception". This simply mean you are using parameters in wrong way. For this webservice two parameters are required. First one is query ( String format) and second is context(Array).
You are using wrong format for context.
Please try http://localhost/moodle3.6.1/webservice/rest/server.php?wstoken=XXXXX&wsfunction=core_cohort_search_cohorts&query=xx&context[contextid]=1&moodlewsrestformat=json

It will give you result.