Skip to main content

Fetching a Configuration

Saved configurations can be fetched from the DIVA service via a dedicated backend API. This is used in the cart integration, where your backend fetches the configuration for a divaNr.

Endpoint​

GET /baskets/<divaNr>?version=<documentVersion>&fields=<requested-fields>

Authentication​

The API key must be provided as a request header:

  • X-API-KEY: <api-key>
warning

Call this API from your backend only. The API key must never be exposed in frontend code.

Parameters​

NameExampleDescriptionRequired
divaNr (path)DIVA-123456The ID of the configuration to be fetchedyes
version (query)3The configuration version. If not provided, the most recent version is fetchedno
fields (query){DivaNr,...}Field selection to avoid fetching the full object. If not provided, the full configuration is returnedno
X-API-KEY (header)xxxAPI key used to authorize the requestyes

Example request (cURL)​

curl -X GET "https://<your-diva-api-host>/baskets/DIVA-123456?version=3&fields=%7BDivaNr%2COrderSets.SetImage%2COrderSets.OrderLines.PosNr%7D" \
-H "X-API-KEY: <api-key>"

Response​

The response is the Configuration Object.

See: The Configuration Object.