code

<?php

// token from oAuth call
$BEARER_TOKEN = "token from oAuth call";

// Host in the URL
$host = "https://api.lufthansa.com/";

$departure = "JFK";
$date = "2015-03-07";
$time_start = "00:00";
$time_end = "23:00";

$context = stream_context_create ( array (
		'http' => array (
				'header' => array (
						'Accept: application/xml',
						'Authorization:Bearer ' . $BEARER_TOKEN 
				) 
		) 
) );

$request_url = $host . 'v1/operations/flightstatus/arrivals/' . $departure . '/' . $date . 'T' . $time_start . '/' . $date . 'T' . $time_end;

try {
	$response_plain = file_get_contents ( $request_url, false, $context );
	$response = new SimpleXMLElement ( $response_plain );
} catch ( Exception $e ) {
	var_dump ( $e->getMessage () );
}
?>
<div class="container">
	<br />
	<h1>Arrivals</h1>

	<h2>All Arrivals in <?php echo($departure)?></h2>

	<div class="table-responsive">
		<table class="table table-striped">
			<thead>
				<tr>
					<td>Arrival From</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>
				<?php
				foreach ( $response->Flights [0]->Flight as $flight ) {
					?>

				<tr>
					<td><?= $flight->Departure->AirportCode?></td>
					<td><?= $flight->Arrival->ScheduledTimeLocal->DateTime?></td>
					<td><?= $flight->Arrival->Terminal->Gate?></td>
					<td><?= $flight->MarketingCarrier->AirlineID ?> </td>
					<td><?= $flight->MarketingCarrier->FlightNumber?></td>
					<td><?= $flight->OperatingCarrier->AirlineID ?> </td>
					<td><?= $flight->OperatingCarrier->FlightNumber?></td>
					<td><?= $flight->Equipment->AircraftCode ?> </td>
					<td><?= $flight->FlightStatus->Code ?> (<?= $flight->FlightStatus->Definition?>)</td>
					<td><?= $flight->Arrival -> TimeStatus->Code ?> (<?= $flight->Arrival -> TimeStatus->Definition?>)</td>
				<?php
				}
				?>
			
			
			
			
			</tbody>
		</table>
	</div>

	<pre class="pre-scrollable">
		<?= htmlentities($response_plain) ?>
	</pre>
</div>
Offers Operations Reference Data oAuth