Reputation: 11
I want to get all moodle data from courses to quizzes to streaming links all as JSON.
I followed the API documentation, got the token, but after that where and how to use this token?
For instance if I want to get the courses list, then how can I do that? If someone can share some example please.
Upvotes: 1
Views: 5834
Reputation: 31
Step 1 : Activate webservices in moodle. Here are the steps : http://docs.moodle.org/dev/Creating_a_web_service_client
http://<your_domain>/webservice/rest/server.php?wstoken=<your_token>&wsfunction=<your_function_name>
To return the response as json you can add &moodlewsrestformat=json
http://<your_domain>/webservice/rest/server.php?wstoken=<your_token>&wsfunction=<your_function_name>&moodlewsrestformat=json
Upvotes: 3
Reputation: 9352
Step 1 : Activate webservices in moodle. Here are the steps : http://docs.moodle.org/dev/Creating_a_web_service_client
Step 2 : Read up the API documentation. This is available in Site administration->plugins->web services->API documentation. This is available only to admin users. Eg the task you want is get courses list, the correct API for this would be "core_course_get_courses". API documentation has details of all available functions.
Upvotes: 1