Blame view

php/rest/getOrbites.php 597 Bytes
16035364   Benjamin Renard   First commit
1
<?php
16035364   Benjamin Renard   First commit
2

70880168   Nathanael Jourdane   Add rate limit on...
3
/**
5e2ea05e   Elena.Budnik   update REST
4
5
 * @file getOrbites.php
 * @brief REST interface for service getOrbites
70880168   Nathanael Jourdane   Add rate limit on...
6
 */
16035364   Benjamin Renard   First commit
7

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

5e2ea05e   Elena.Budnik   update REST
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
	if (!key_exists("token", $_GET)) 
	{
		$result = array('success' => false, 'message' => "Authentication is required for this webservice.");
		exit(json_encode($result));
	} 
	
	$amda_ws = new WebServer();
	
	if ($amda_ws->getNewToken()['token'] != $_GET["token"]) 
	{
		$result = array('success' => false, 'status' => 'expired', 'message' => "Token expired. Please authenticate again.");
	} else 
	{
		$result = $amda_ws->getOrbites($_GET);
	}
70880168   Nathanael Jourdane   Add rate limit on...
25

5e2ea05e   Elena.Budnik   update REST
26
	echo json_encode($result);
16035364   Benjamin Renard   First commit
27
28

?>