Blame view

php/rest/getCatalogsList.php 1.03 KB
0123b9fe   Benjamin Renard   Add APIs getCatal...
1
2
3
4
5
6
7
8
9
10
11
12
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
39
40
<?php

/**
 * @api {get} getCatalogsList.php getCatalogsList
 * @apiDescription Provides the private list of Catalogs owned by a user. When called without
 * userID, this web-service returns the list of shared Catalogs.
 *
 * @apiName getCatalogsList
 * @apiGroup webservices
 *
 * @apiParam {String} [userID] Identifier of the user in AMDA.
 * @apiParam {String} [password] Password of the user in AMDA.
 *
 * @apiSuccess {String} success `true`
 * @apiSuccess {String} CatalogsList URL of the XML file, which contains the list of Catalogs.
 *
 * @apiSuccessExample Success-Response:
 *     HTTP/1.1 200 OK
 *     [success] => 1
 *     [CatalogsList] =>  http://amda.irap.omp.eu/data/WSRESULT/catalogs_impex_20180905.xml
 *
 * @apiErrorExample Error-Response:
 *     {"error": "Workspace Error : Cannot load Catalogs list for userID"}
 */

	require_once '../config.php';

	$amda_ws = new WebServer();

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

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