GET /v4/products/embed
(Last updated: 03/10/2023)
Request
Method
GET
URL
https://api.medipim.fr/v4/products/embed
Parameters
id
: product ID (required)locale
: language in which the response should be shown (required, defaults tofr
)
Response
An HTML page presenting product information.
Signing the URL
If you are embedding this endpoint into a webpage or app, it may not be possible to use HTTP Basic auth. In that case, you can authenticate this request by adding a message authentication code to the URL.
Tip
If you are using the PHP client, you can generate a signed URL using ->createProductEmbedUrl($productId)
.
Tip
The GET /v4/products/find response includes a signed URL.
Tip
Example code to generate a signed URL manually:
<?php
$unixTimestamp = time(); // Unix Timestamp
$productId = 'xxx'; // Product ID
$apiSecretKey = 'ApikeySecret'; //API key secret;
$apiKeyId = 'ApiKeyId'; //API key ID
$message = "embed:" . $productId . ":" . $unixTimestamp;
$mac = hash_hmac("sha256", $message, $apiSecretKey);
$query = http_build_query([
"id" => (string) $productId,
"t" => $unixTimestamp,
"key" => (string) $apiKeyId,
"mac" => $mac,
]);
return "https://" . $this->apiDomain . "/v4/products/embed?" . $query;