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 the all the Flight Information of a particular Flight</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>Flight Status Response</h1>

        <h2 id="FlightHeader">Flights from to </h2>

        <div class="table-responsive">
            <table class="table table-striped" id="table">
                <thead>
					<tr>
					<td>Departure Time Local</td>
					<td>Arrival Time Local</td>
					<td>Terminal Departure</td>
					<td>Terminal Arrival</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 Arrival</td>
					<td>Time Status Departure</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/route/';
	
		var departure = "FRA";
		var arrival = "JFK";
		var date = "2015-03-03";
		var bearer_token = "hpq47zn2b8mmn4p7hb3yuzqj";
		
		//current date?
		if (true){
			url += departure + '/' + arrival + '/' + today;
		} else {
			url += departure + '/' + arrival + '/' + date;;			
		}
	
		$("h2").text("Flights from "+ departure + " to " + arrival);

		(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 timeStatusArr = arrival[0].getElementsByTagName("TimeStatus");
					var timeStatusDep = departure[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('DateTime')[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 = departure[0].getElementsByTagName('Gate')[0].childNodes[0].nodeValue;
					}
					catch(e) {
					}

					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 = timeStatusArr[0].getElementsByTagName('Code')[0].childNodes[0].nodeValue;

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

				}
			})
		})()
    </script>
</body>
</html>
Offers Operations Reference Data oAuth