Blame view

php/rest/getCatalog.php 1.24 KB
0123b9fe   Benjamin Renard   Add APIs getCatal...
1
2
3
4
5
6
7
8
9
10
11
<?php

/**
 * @api {get} getCatalog.php getCatalog
 * @apiDescription Provides the contents of a Time Table (TT).
 * @apiName getCatalog
 * @apiGroup webservices
 *
 * @apiParam {String} catID Identifier of the Catalog, as defined in the file returned by the « getCatalogsList » 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*)
26dbe95d   Benjamin Renard   outputFormat for ...
12
 * @apiParam {String} [outputFormat] Format of the returned file (VOTable by default). Available options: `VOTable`, `ASCII` and `HPEvent`.
0123b9fe   Benjamin Renard   Add APIs getCatal...
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 *
 * @apiSuccess {String} success `true`
 * @apiSuccess {String} catFileURL URL of the XML file containing the Catalog (VOTable format)
 *
 * @apiSuccessExample Success-Response:
 *     HTTP/1.1 200 OK
 *     [success] => 1
 *     [ttFileURL] => http://amda.irap.omp.eu/AMDA/data/WSRESULT/catalog_userID_20180919_cat_0.xml
 *
 * @apiErrorExample Error-Response:
 * {"error":"No such table sharedcatalog_100 for user impex"}
 */

require_once '../config.php';

  $amda_ws = new WebServer();

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

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