code

<?php
$BEARER_TOKEN = "token from oAuth call";

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

// Parameters
$aircraft_code = ""; // Leave Blank for all aircrafts

$context = stream_context_create ( array (
		'http' => array (
				'header' => array (
						'Accept: application/json',
						'Authorization:Bearer ' . $BEARER_TOKEN 
				) 
		) 
) );
$url = $host . 'v1/references/aircraft/' . $aircraft_code;

try {
	$response_plain = file_get_contents ( $url, false, $context );
	$response = json_decode ( $response_plain, true );
} catch ( Exception $e ) {
	var_dump ( $e->getMessage () );
}

?>
<div class="container">

	<h1>Aircraft Information</h1>
	<p>&nbsp;</p>
	<div class="table-responsive">
		<table class="table table-striped">
			<thead>
				<tr>
					<th>AircraftCode</th>
					<th>Name</th>
					<th>AirlineEquipCode</th>
				</tr>
			</thead>
			<tbody>
				<?php
				foreach ( $response ['AircraftResource'] ['AircraftSummaries'] ['AircraftSummary'] as $aircraft ) {
					?>
					<tr>
					<td><?= $aircraft['AircraftCode'] ?></td>
					<td><?= $aircraft['Names']['Name']['$'] ?></td>
					<td><?= $aircraft['AirlineEquipCode'] ?></td>
				</tr>
				<?php }	?>
			</tbody>
		</table>
	</div>

	<pre class="pre-scrollable">
		<?= htmlentities($response_plain)?>
	</pre>

</div>
Offers Operations Reference Data oAuth