code

<?php

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

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

$departure = "HAM";
$date = "2015-03-07";
$time_start = "09:00";
$time_end = "18:00";

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

try {
	$context = stream_context_create ( array (
			'http' => array (
					'header' => array (
							'Accept: application/xml',
							'Authorization:Bearer ' . $BEARER_TOKEN 
					) 
			) 
	) );
	$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>Departures</h1>

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

	<div class="table-responsive">
		<table class="table table-striped">
			<thead>
				<tr>
					<td>Departure To</td>
					<td>Departure Time Local</td>
					<td>Departure 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->Arrival->AirportCode?></td>
					<td><?= $flight->Arrival->ScheduledTimeLocal->DateTime?></td>
					<td><?= $flight->Departure->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->Departure ->TimeStatus->Code ?> (<?= $flight->Departure->TimeStatus->Definition?>)</td>
				</tr>
				<?php }	?>
			</tbody>
		</table>
	</div>

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