Skip to main content

Experience API

You interact with the DX Engine in real-time via the Experience API. This API endpoint is the only service that your frontend will need to know about if you use the DXO in your composable architecture. Instead of making several calls to the various backend APIs such as the Commerce Engine, CMS, Promotions Engine, CDP, etc, you need to make only one Experience API call with the current context of the customer such as their location, navigational context, customerID, etc, and the DX Engine will orchestrate the various backend APIs to deliver the desired experience. The API returns the instructions to the frontend broken down into components that map to visual components on a page/screen in a JSON format that is agnostic of the frontend framework.

Note that the Experience API does not deliver any markup - the manner in which the front end renders itself or the frontend framework you use is not a concern of the DX Engine. You can think of a DX Engine Component as a Backend-for-Frontend (BFF). For instance, if you have a header banner visual Component on the frontend, the DX Engine Component is simply providing the data and content necessary to render that visual Component on the front end. A DX Engine Component connects to a backend API such as a headless CMS, a DAM or a Commerce Engine and sources data directly from that backend in real-time based on the experience logic configured by your digital team.

Using the Experience API is simple and requires only two query parameters: Context, one of Components or Template.

A sample query is as follows:

POST {{engineUrl}}/experience/components/_query
X-Customer-Code: {{customerCode}}
Authorization: Bearer {{dxEngineToken}}

{
"componentCodes": ["user", "movies"],
"context": {
"userId": "pepper@iron.com",
"genre": "drama"
}
}

A sample response will look like this:

{
"duration": 198,
"components": {
"user": {
"status": "VALID",
"response": [
{
"id": "pepper@iron.com",
"favouriteGenre": "horror"
}
]
},
"movies": {
"status": "VALID",
"response": [
{
"id": "tt8250078",
"titleType": "movie",
"primaryTitle": "Sink",
"originalTitle": "Sink",
"startYear": 2018,
"runtimeMinutes": 7,
"isAdult": false,
"genres": [
"drama"
],
"directors": [
"nm9757557"
],
"writers": [
"nm8337244"
],
"actors": [
"nm0692305",
"nm5073992",
"nm0936087",
"nm9757554",
"nm9757555"
]
},
{
"id": "tt8251336",
"titleType": "movie",
"primaryTitle": "No One Will Ever Know",
"originalTitle": "Nadie sabrá nunca",
"startYear": 2018,
"runtimeMinutes": 102,
"isAdult": false,
"genres": [
"drama"
],
"directors": [
"nm2571065"
],
"writers": [
"nm2571065"
],
"actors": [
"nm2578315",
"nm2784856",
"nm1173803",
"nm0709204"
]
},
{
"id": "tt8254556",
"titleType": "movie",
"primaryTitle": "Girl",
"originalTitle": "Girl",
"startYear": 2018,
"runtimeMinutes": 109,
"isAdult": false,
"genres": [
"drama"
],
"directors": [
"nm4080113"
],
"writers": [
"nm4080113",
"nm3899543"
],
"actors": [
"nm9760132",
"nm3581007",
"nm9854120",
"nm7904438"
]
},
{
"id": "tt8257434",
"titleType": "movie",
"primaryTitle": "Kaaneen: A Secret Search",
"originalTitle": "Kaaneen: A Secret Search",
"startYear": 2018,
"runtimeMinutes": 135,
"isAdult": false,
"genres": [
"drama"
],
"directors": [
"nm9761042",
"nm8646148"
],
"writers": [],
"actors": []
},
{
"id": "tt8235296",
"titleType": "movie",
"primaryTitle": "The Trump Prophecy",
"originalTitle": "The Trump Prophecy",
"startYear": 2018,
"runtimeMinutes": 120,
"isAdult": false,
"genres": [
"drama"
],
"directors": [
"nm0776398"
],
"writers": [
"nm9444786",
"nm1205833",
"nm2052673",
"nm9444787"
],
"actors": [
"nm8985653",
"nm1690749",
"nm1982532",
"nm1546204"
]
}
]
}
}
}

If you have gained access to the DX Engine Sandbox, you can try out the Experience API.

Please visit the DX Engine API page.

We also have a DX Engine Postman collection. Go here to learn more.