getParameter.php
603 Bytes
<?php
/**
* @file getParameter.php
* @brief REST interface for service getParameter
*/
require_once '../config.php';
if (!key_exists("token", $_GET))
{
$result = array('success' => false, 'message' => "Authentication is required for this webservice.");
exit(json_encode($result));
}
$amda_ws = new WebServer();
if ($amda_ws->getNewToken()['token'] != $_GET["token"])
{
$result = array('success' => false, 'status' => 'expired', 'message' => "Token expired. Please authenticate again.");
} else
{
$result = $amda_ws->getParameter($_GET);
}
echo json_encode($result);
?>