getTimeTable.php 1.12 KB
<?php

/**
 * @api {get} getTimeTable.php getTimeTable
 * @apiDescription Provides the contents of a Time Table (TT).
 * @apiName getTimeTable
 * @apiGroup webservices
 *
 * @apiParam {String} ttID Identifier of the Time Table, as defined in the file returned by the « getTimeTableList » service.
 * @apiParam {String} [userID] Identifier of the user in AMDA (*mandatory for user owned data*)
 * @apiParam {String} [password] Password of the user in AMDA (*mandatory for user owned data*)
 *
 * @apiSuccess {String} success `true`
 * @apiSuccess {String} ttFileURL URL of the XML file containing the Time Table (VOTable format)
 *
 * @apiSuccessExample Success-Response:
 *     HTTP/1.1 200 OK
 *     [success] => 1
 *     [ttFileURL] => http://amda.irap.omp.eu/AMDA/data/WSRESULT/timetable_userID_20180919_tt_0.xml
 *
 * @apiErrorExample Error-Response:
 * {"error":"No such table sharedtimeTable_100 for user impex"}
 */

require_once '../config.php';

  $amda_ws = new WebServer();

  $result = $amda_ws->getTimeTable($_GET);

 if ($result['success']){
	echo $result['ttFileURL'];
   }
    else {
     echo $result['message'];  
    }
?>