array(
‘X-API-KEY’ => $api_key,
),
‘body’ => array(
‘customer_code’ => $customer_code,
‘lang’ => ‘EN’,
),
);
// Make the API call using wp_remote_get()
$response = wp_remote_get( $endpoint, $params );
// Retrieve the response body using wp_remote_retrieve_body()
$body = wp_remote_retrieve_body( $response );
// Decode the JSON response using json_decode()
$data = json_decode( $body );
// Display the API response data on your WordPress page
if ( ! empty( $data ) ) {
// Customize the HTML output as per your requirement
echo ‘
- ‘;
- ‘ . $license->name . ‘: ‘ . $license->amount . ‘ ‘ . $license->currency . ‘
foreach ( $data as $license ) {
echo ‘
‘;
}
echo ‘
‘;
} else {
echo ‘No licenses available’;
}
?>