Create a Moodle script and use the Moodle REST-JSON client: /webservice/rest/lib.php:webservice_rest_client. You can take example of the REST-JSON demo client ( https://github.com/moodlehq/sample-ws-clients/tree/master/PHP-REST ) to see how to use it.