How to use Moodle webservices

How to use Moodle webservices

by Naqi Azam -
Number of replies: 3

Hello, I'm new to moodle's webservices and I wish to try creating a course via the core_course_create_courses function.

I'm calling the webservice with the following url and its giving me an error, can someone help me out here please.

uri: http://localhost/moodle/webservice/rest/server.php?wstoken=d0b8004660ba1144f8af3e8478ec6b01&moodlewsrestformat=json&wsfunction=core_course_create_courses

error: 

{"exception":"invalid_parameter_exception","errorcode":"invalidparameter","message":"Invalid parameter value detected"}

I'm unable to understand the cause of the error its saying the a parameter has an invalid value but which one? and why?
Attachment 2021-04-16 21_53_41-Window.png
Average of ratings: -
In reply to Naqi Azam

Re: How to use Moodle webservices

by Omar Esgaib -
Probably has to do with the data sent to the WS and not the url, you need to pass data for the course to be created, that is the information with error probably and in this case, it looks like it is missing from the WS call or you do not mention it in the message
In reply to Omar Esgaib

Re: How to use Moodle webservices

by Alisson Silva -

Would you be able to tell me where I find the specification of the input and return parameters of this call to the API's core_course_create_courses method?