post




API Example


API Example

$sessionId, ‘partNumber’ => $partNumber);

$options = array(
‘http’ => array(
‘header’ => ‘Content-type: application/x-www-form-urlencoded’,
‘method’ => ‘POST’,
‘content’ => http_build_query($data),
),
);

$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);

// Parse the JSON response
$response = json_decode($result, true);

// Display the search bar and results table
if ($response && count($response) > 0) {
echo ‘

‘;
echo ‘‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
foreach ($response as $part) {
echo ‘

‘;
}
echo ‘

Part Number Description
‘ . $part[‘PartNumber’] . ‘ ‘ . $part[‘Description’] . ‘

‘;
} else {
echo ‘

No results found.

‘;
}
?>