Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
client_airnotifier_system.php
<?php
// This file is NOT a part of Moodle - http://moodle.org/
//
// This client for Moodle 2 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
/// SETUP - NEED TO BE CHANGED
//
// Token
$token = '298dee2e40eeac025a642e6231599917';
$domainname = 'http://localhost/moodlebugs';
// REST RETURNED VALUES FORMAT
$restformat = 'json'; //Also possible in Moodle 2.2 and later: 'json'
//Setting it to 'json' will fail all calls on earlier Moodle version
$restformat = ($restformat == 'json')?'&moodlewsrestformat=' . $restformat:'';
/// REST CALL
header('Content-Type: text/plain');
require_once('./curl.php');
$curl = new curl;
$functionname = 'message_airnotifier_is_system_configured';
$params = array();
$serverurl = $domainname . '/webservice/rest/server.php'. '?wstoken=' . $token . '&wsfunction='.$functionname;
$resp = $curl->post($serverurl . $restformat, $params);
$resp = json_decode($resp);
print_r($resp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.