GET /v3/products/embed
Note
Access to this feature is restricted.
Request
Method
GET
URL
https://api.medipim.be/v3/products/embed
Parameters
id
: product ID (required, unless you providecnk
)cnk
: product CNK (required, unless you provideid
)locale
: language in which the response should be shown (nl
,fr
oren
, defaults tonl
)
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 /v3/products/get response includes a signed URL.
Tip
Example code to generate a signed URL manually:
<?php<br /><br />$unixTimestamp = time(); // Unix Timestamp<br />$productId = 'xxx'; // Product ID<br />$apiSecretKey = 'ApikeySecret'; //API key secret;<br />$apiKeyId = 'ApiKeyId'; //API key ID<br /><br />$message = "embed:" . productId . ":" . unixTimestamp;<br />$mac = hash_hmac("sha256", message, apiSecretKey);<br /><br />$query = http_build_query([<br /> "id" => (string) productId,<br /> "t" => unixTimestamp,<br /> "key" => (string) apiKeyId,<br /> "mac" => mac,<br />]);<br /><br />return "https://" ~ apiDomain ~ "/v3/products/embed?" . query;