code

<?php

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

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

$departure = 'FRA';
$arrival = 'JFK';
$date = '2015-04-28';

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

$request_url = $host . 'v1/operations/schedules/' . $departure . '/' . $arrival . '/' . $date;

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>Scheduled Flights</h1>

	<h2>All scheduled flights between <?php echo($departure)?> and <?php echo($arrival)?> at <?php echo($date)?></h2>

	<div class="table-responsive">
		<table class="table table-striped">
			<thead>
				<tr>
					<td>Departure Time Local</td>
					<td>Departure Terminal</td>
					<td>Arrival Time Local</td>
					<td>Arrival Terminal</td>
					<td>Airline ID</td>
					<td>Flight Number</td>
					<td>Aircraft Code</td>
					<td>Stops</td>
					<td>Days Of Operation</td>
				</tr>
			</thead>
			<tbody>
				<?php
				foreach ( $response->Schedule as $flight ) {
					?>

				<tr>
					<td><?= $flight->Flight->Departure->ScheduledTimeLocal->DateTime?></td>
					<td><?= $flight->Flight->Departure->Terminal->Name?></td>
					<td><?= $flight->Flight->Arrival->ScheduledTimeLocal->DateTime?></td>
					<td><?= $flight->Flight->Arrival->Terminal->Name?></td>
					<td><?= $flight->Flight->MarketingCarrier->AirlineID ?> </td>
					<td><?= $flight->Flight->MarketingCarrier->FlightNumber?></td>
					<td><?= $flight->Flight->Equipment->AircraftCode ?> </td>
					<td><?= $flight->Flight->Details->Stops->StopQuantity ?></td>
					<td><?= $flight->Flight->Details->DaysOfOperation ?></td>
				</tr>
				<?php }	?>
			</tbody>
		</table>
	</div>

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