auth.php 552 Bytes
<?php

/**
 * @api {get} auth.php auth
 * @apiDescription Returns a token to use as an API parameter for *getParameter*, *getOrbites* and *getTimeTable*.
 * @apiName auth
 * @apiGroup webservices
 *
 * @apiSuccess {String} token The API token.
 *
 * @apiSuccessExample Success-Response:
 *     HTTP/1.1 200 OK
 *     4aca24fe814302a6dbceea3f4360c9b9
 */

require_once '../config.php';

$amda_ws = new WebServer();
$result = $amda_ws->getNewToken($_GET);

if ($result['success']) {
    echo $result['token'];
} else {
    echo $result['message'];
}

?>