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
| Name | Example | Description | Required |
|---|---|---|---|
divaNr (path) | DIVA-123456 | The ID of the configuration to be fetched | yes |
version (query) | 3 | The configuration version. If not provided, the most recent version is fetched | no |
fields (query) | {DivaNr,...} | Field selection to avoid fetching the full object. If not provided, the full configuration is returned | no |
X-API-KEY (header) | xxx | API key used to authorize the request | yes |
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.