Web Service Responses in JSON Format

To get web service responses in JSON format (e.g. with the REST protocol), you can pass the query parameter moodlewsrestformat=json. The default convention with Moodle is return web service responses in XML format.

E.g. you might a URL that looks like this (broken into segments for clarity):


This one is calling the core_webservice_get_site_info function with a token, and specifying that the output format needs to be JSON.

Revision #1
Created Thu, Feb 13, 2020 11:14 PM by Moodle Wiki
Updated Thu, Feb 13, 2020 11:16 PM by Moodle Wiki