Medipim BE - API V4

Developer documentation

GET /v4/products/embed

(Last updated: 18/03/2024)

Request

Method

GET

URL

https://api.medipim.be/v4/products/embed

Headers

Only provide authorization headers if you are not signing the url (see "Signing the URL" below for more information)

Parameters

  • id: Medipim ID of the product (string, required unless you provide another identifier)
  • locale: language in which the response should be shown (required, defaults to the primary language of the platform)

Besides the Medipim ID you can also use any of the unique product identifiers that are available.

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;