by Robert Payne.
Hello,
I'm trying to use Moodle Rest Web Service to get a list of all system cohorts so that I can compare it with a list from outside moodle and then update the cohort to match that list if it does not match.
I'm currently caught up on the first step though as I'm not sure how to get the list of cohorts. I'm trying to use the "core_cohort_search_cohorts" but am not sure how to use the context array parameter.
Currently I'm trying to use the default options from the generated documentation of [0,'',0] but it still returns the error of:
{ exception: 'invalid_parameter_exception', errorcode: ' invalidparameter', message: 'Invalid parameter value detected', debuginfo: 'context => Invalid parameter value detected: Unexpected keys (0, 1, 2) detected in parameter array.' }
I'm not sure what I should be passing here. Anyone used this before or have any idea of what I should be doing here?
Thanks for your time,
Rob