getDataset.php 597 Bytes
<?php
/**
 * @file getDataset.php
 * @brief  REST interface for service getDataset
 */
 
//ini_set("allow_url_fopen", true);
require_once '../config.php';

$amda_ws = new WebServer();

if (!key_exists("token", $_GET)) {
    $result = array('success' => false, 'message' => "Authentication is required for this webservice.");
} else if ($amda_ws->getNewToken()['token'] != $_GET["token"]) {
    $result = array('success' => false, 'status' => 'expired', 'message' => "Token expired. Please authenticate again.");
} else {
    $result = $amda_ws->getDataset($_GET);
}

echo json_encode($result);
?>