Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2362

Re: REST Service core_course_create_courses

$
0
0
by Jerry Ahern.  

Hi Joshua,

I'm having trouble with this REST service too. I haven't written any code yet, I'm trying to call the web service directly using a Chrome extension called Postman (see screenshot).

I've followed the instructions precisely to enable the service: 

  • enabled the web service
  • enabled the REST protocol
  • created a user and set their capability
  • created a service and assigned the correct function and user
  • created a token for the user

However, when passing in my wstoken, wsfunction (core_course_create_courses) and moodlewsrestformat (json), and the following values:

  • courses[0][fullname] = "Get Started with Moodle"
  • courses[0][shortname] = "01MOOD"
  • courses[0][categeoryid] = "101" (the category 101 does exist)

I'm getting this error: Missing required key in single structure: courses.

Can you tell me how you got past this error? What other errors did you resolve? I know this was a while ago but I can't seem to find much information (on forums or otherwise) about core_course_create_courses.

Thanks in advance,

Jerry


Viewing all articles
Browse latest Browse all 2362

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>