Blame view

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

/**
0cb6a7aa   Myriam Bouchemit   add info for apidoc
4
 * @api {get} getTimeTablesList.php getTimeTablesList
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
5
6
7
 * @apiDescription Provides the private list of Time Tables (Time Table or TT) owned by a user. When called without
 * userID, this web-service returns the list of shared Time Tables.
 *
0cb6a7aa   Myriam Bouchemit   add info for apidoc
8
 * @apiName getTimeTablesList
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
9
10
11
12
13
14
15
16
 * @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} TimeTablesList URL of the XML file, which contains the list of Time Tables.
 *
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
17
 * @apiSuccessExample Success-Response:
0cb6a7aa   Myriam Bouchemit   add info for apidoc
18
19
20
 *     HTTP/1.1 200 OK
 *     [success] => 1
 *     [TimeTablesList] =>  http://amda.irap.omp.eu/data/WSRESULT/timetables_impex_20180905.xml
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
21
 *
ddedb507   Myriam Bouchemit   layout for apidoc
22
 * @apiErrorExample Error-Response:
6185ceeb   Myriam Bouchemit   update for apidoc
23
 *     {"error": "Workspace Error : Cannot load TimeTable list for userID"}
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
24
 */
16035364   Benjamin Renard   First commit
25

5e2ea05e   Elena.Budnik   update REST
26
	require_once '../config.php';
16035364   Benjamin Renard   First commit
27

5e2ea05e   Elena.Budnik   update REST
28
	$amda_ws = new WebServer();
16035364   Benjamin Renard   First commit
29

5e2ea05e   Elena.Budnik   update REST
30
	$result = $amda_ws->getTimeTablesList($_GET);
16035364   Benjamin Renard   First commit
31

5e2ea05e   Elena.Budnik   update REST
32
33
34
35
36
37
38
39
	if ($result['success'])
	{
		echo $result['TimeTablesList'];
	}
	else 
	{
		echo $result['message'];  
	}
16035364   Benjamin Renard   First commit
40
?>