code

<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="http://code.jquery.com/jquery-1.10.1.min.js"
	type="text/javascript"></script>
<title>Get all Arrivals in</title>
<link rel="stylesheet"
	href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"
	type="text/css">
</head>

<body>
	<div class="container">
		<br>

		<h1>Scheduled Flights</h1>

		<h2 id="FlightHeader">Get all Arrivals in</h2>

		<div class="table-responsive">
			<table class="table table-striped" id="table">
				<thead>
					<tr>
						<td>Origin</td>
						<td>Arrival Time Local</td>
						<td>Arrival Gate</td>
						<td>Marketing Airline ID</td>
						<td>Marketing Flight Number</td>
						<td>Operating AirlineID</td>
						<td>Operating Flight Number</td>
						<td>Aircraft Code</td>
						<td>FlightStatus</td>
						<td>Time Status</td>
					</tr>
				</thead>

				<tbody id="tbody">
				</tbody>
			</table>
		</div>
		<pre class="pre-scrollable">
            
		</pre>
	</div>
	<script type="text/javascript">
		var today = new Date();
		var dd = ((today.getDate()<10) ? '0':'' )+today.getDate();
		//January is 0!
		var mm = ((today.getMonth()<9) ? '0':'' )+(today.getMonth()+1); 
		var yyyy = today.getFullYear();

		var today = yyyy +'-' + mm + '-' + dd;

		var host = 'api.lufthansa.com';
		var url = 'https://'+host+'/v1/operations/flightstatus/arrivals/';

		var destination = "FRA";
		var date = "2015-03-03";
		var time_start = "09:00";
		var time_end = "18:00";
		var bearer_token = "hpq47zn2b8mmn4p7hb3yuzqj";
		
		//current date?
		if (true){
			url += destination + '/' + today + 'T' + time_start + '/' + today + 'T' + time_end;
		} else {
			url += destination + '/' + date + 'T' + time_start + '/' + date + 'T' + time_end;			
		}


		$("h2").text("Get all Arrivals in " + destination);
		
		
		(function doGet() {
			$.ajax({
				type: 'GET',
				url: url ,
				dataType: 'xml',
				headers: {
					accept: "application/xml",
					authorization:"Bearer "+bearer_token
				}
			}).done(function(data) {

				var flightGroup = data.getElementsByTagName('Flight');
	
				$("pre").text(data.documentElement.outerHTML);
	
	
				for (var i = 0; i < flightGroup.length; i++) {
	
					var departure = flightGroup[i].getElementsByTagName("Departure");
					var arrival = flightGroup[i].getElementsByTagName("Arrival");
					var marketingCarrier = flightGroup[i].getElementsByTagName("MarketingCarrier");
					var operatingCarrier = flightGroup[i].getElementsByTagName("OperatingCarrier");
					var flightStatus = flightGroup[i].getElementsByTagName("FlightStatus");
					var timeStatus = arrival[0].getElementsByTagName("TimeStatus");
					

					
					$("table").find('tbody').append($('<tr id=' + i + '>'));
					
					var row = document.getElementById(i);
					
					var x = row.insertCell(-1);
					x.innerHTML = departure[0].getElementsByTagName('AirportCode')[0].childNodes[0].nodeValue;
	
					var x = row.insertCell(-1);
					x.innerHTML = arrival[0].getElementsByTagName('DateTime')[0].childNodes[0].nodeValue;
	
	
					var x = row.insertCell(-1);
					try {					
						x.innerHTML = arrival[0].getElementsByTagName('Gate')[0].childNodes[0].nodeValue;
					}
					catch(e) {
					}

					var x = row.insertCell(-1);
					x.innerHTML = marketingCarrier[0].getElementsByTagName('AirlineID')[0].childNodes[0].nodeValue;

					var x = row.insertCell(-1);
					x.innerHTML = marketingCarrier[0].getElementsByTagName('FlightNumber')[0].childNodes[0].nodeValue;

					var x = row.insertCell(-1);
					x.innerHTML = operatingCarrier[0].getElementsByTagName('AirlineID')[0].childNodes[0].nodeValue;

					var x = row.insertCell(-1);
					x.innerHTML = operatingCarrier[0].getElementsByTagName('FlightNumber')[0].childNodes[0].nodeValue;

					var x = row.insertCell(-1);
					x.innerHTML = flightGroup[i].getElementsByTagName('AircraftCode')[0].childNodes[0].nodeValue;
	
					var x = row.insertCell(-1);
					try{
						x.innerHTML = flightStatus[0].getElementsByTagName('Code')[0].childNodes[0].nodeValue;
					} catch (e){
						x.innerHTML = 'NA';
					}
					
					var x = row.insertCell(-1);
					x.innerHTML = timeStatus[0].getElementsByTagName('Code')[0].childNodes[0].nodeValue;
	
				}
			})
		})()
    </script>
</body>
</html>
Offers Operations Reference Data oAuth