Blame view

php/rest/getParameterList.php 1.6 KB
16035364   Benjamin Renard   First commit
1
<?php
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
2
3
4

/**
 * @api {get} getParameterList.php getParameterList
6185ceeb   Myriam Bouchemit   update for apidoc
5
 * @apiDescription Provides the hierarchy of derived parameters belonging to a user and parameters in AMDA.
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
6
7
8
 * @apiName getParameterList
 * @apiGroup webservices
 *
4599eb6c   Myriam Bouchemit   userID optionnel
9
10
 * @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*)
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
11
12
 *
 * @apiSuccess {String} success `true`
6185ceeb   Myriam Bouchemit   update for apidoc
13
 * @apiSuccess {String} URL of the XML file, which contains the list of derived parameters and parameters in AMDA
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
14
 *
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
15
16
17

 * @apiSuccessExample Success-Response:
 *     HTTP/1.1 200 OK
0cb6a7aa   Myriam Bouchemit   add info for apidoc
18
19
20
21
22
23
24
25
26
27
28
29
 *     [success] => 1
 *         [ParameterList] => stdClass Object
 *      (
 *          [LocalDataBaseParameters] => http://amda.irap.omp.eu/AMDA/data/WSRESULT/parameterlist_impex_20180919_AmdaLocalDataBaseParameters.xml
 *      )
 *      or with userID
 *      (
 *          [UserDefinedParameters] => http://amda.irap.omp.eu/AMDA/data/WSRESULT/parameterlist_userID_20180919_UserDefinedParameters.xml
 *          [LocalDataBaseParameters] => http://amda.irap.omp.eu/AMDA/data/WSRESULT/parameterlist_userID_20180919_AmdaLocalDataBaseParameters.xml
 *      )
 *
 *
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
30
 *
ddedb507   Myriam Bouchemit   layout for apidoc
31
 * @apiErrorExample Error-Response:
6185ceeb   Myriam Bouchemit   update for apidoc
32
 *     {"error":"Login procedure failed for impex1 : Check your password"}
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
33
 */
16035364   Benjamin Renard   First commit
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

  require_once '../config.php';

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

    if ($result['ParameterList']){
      foreach($result['ParameterList'] as $key => $value) {
	echo "<$key>$value</$key><br/>";
      }
    }
    else {
     echo $result['message'];  
    }
?>