REST Web service - Missing required key in single structure: groups

REST Web service - Missing required key in single structure: groups

by Alex Legg -
Number of replies: 3

So the following is a REST call to sever.php, It successfully uses the token and calls the external function:

http://collectiveintelligencerepository.com/webservice/rest/server.php?wstoken=dd70e39c37d50d9e806305eab51c4593&wsfunction=local_myplugin_create_groups

The required parameters from the accessible external function are:

courseid => PARAM_INT
name => PARAM_TEXT
description => PARAM_RAW
enrolmentkey => PARAM_RAW

I have tried the following:

http://collectiveintelligencerepository.com/webservice/rest/server.php?wstoken=dd70e39c37d50d9e806305eab51c4593&wsfunction=local_myplugin_create_groups&courseid=10&name=tgmg&description=thisisadescription&enrolmentkey=5

And get an error...

<EXCEPTION class="invalid_parameter_exception">
<ERRORCODE>invalidparameter</ERRORCODE>
<MESSAGE>Invalid parameter value detected</MESSAGE>
<DEBUGINFO>Missing required key in single structure: groups</DEBUGINFO>
</EXCEPTION>

Average of ratings: Useful (1)
In reply to Alex Legg

Re: REST Web service - Missing required key in single structure: groups

by Alex Legg -

Plugin permissions were incorrect.

In reply to Alex Legg

Re: REST Web service - Missing required key in single structure: groups

by Alexis Rengifo -

Hey Alex. Where exactly did you set up plugin permissions?

I am running my custom rest service and having the same response from the server (the one you mentioned on top)

In reply to Alexis Rengifo

Re: REST Web service - Missing required key in single structure: groups

by Mohammad Gholipour -
Hi alexis

did you fix reported error?

I have such a problem to test create_category service.

I did it at https://demo.moodle.net  and it was successful, but in my site following error was occurred.

If you have founded the solution please help me?

error