Created
September 18, 2018 18:56
-
-
Save FabianPastor/ce23433d6c523ea6ffa002220e4801e8 to your computer and use it in GitHub Desktop.
Pequeño script para usar la API REST de Moodle del AulaVirtual de la Universidad de Valencia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
$function = "core_webservice_get_site_info"; | |
$host = "https://aulavirtual.uv.es"; | |
$apiRest = "/webservice/rest/server.php"; | |
$token = "0123456789"; | |
$options = new stdClass(); | |
$options->moodlewsrestformat = "json"; | |
$options->wstoken = $token; | |
$options->wsfunction = $function; | |
$url = $host.$apiRest."?".http_build_query($options); | |
var_dump(json_decode(file_get_contents($url))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment