Page Delivery API - Bloomreach Experience - Headless Digital Experience Platform

Page Delivery API

What does the Page Delivery API do?

The Page Delivery API provides a REST endpoint for SPAs to retrieve JSON representations of pages in a brX channel including all the components, content items and menus of which those pages are comprised.

Following the core principles of HATEOAS, the SPA enters the REST application through a brX navigational URL and discovers all possible future client interactions within the resource representations returned from the server.

Additionally, the Page Delivery API provides seamless integration with the channel preview and page management features of the Experience manager in brX.

Example request and response

An example request for the root (homepage) of a channel looks like this:

GET /delivery/site/v1/channels/brxsaas/pages HTTP/1.1
Host: example.brxsaas.bloomreach.cloud
Accept: application/json
...

The JSON response is of the following structure:

HTTP/1.1 200 OK
Access-Control-Allow-Origin: https://example.brxsaas.bloomreach.cloud
API-Version: 1.0
Content-Type: application/json;charset=UTF-8
Content-Length: ...
...
{
   "meta":{   
      "product": "brx",
      "version":"1.0",
      "branch":"master"
   },
   "links":{
      "self":{
         "href":"https://example.brxsaas.bloomreach.cloud/site/api/brxsaas/page",
         "type":"external"
      },
      "site":{
         "href":"/",
         "type":"internal"
      }
   },
   "channel":{
      "info":{
         "props":{
            graphql_baseurl: "http://localhost:4000",
            "smDomainKey":"",
            "smAccountId":"1234",
            "smEndpoint":"https://core.dxpapi.com/api/v1/core/",
            "spaUrl":"https://brxm-react-spa.herokuapp.com/"
         }
      }
   },
   "root":{
      "$ref":"/page/u6b031ebfe46f46cd9ecdf430fa952f34"
   },
   "document":{
      "$ref":"/page/u10811792bf4b42c4bbf1ab303fc5ebcf"
   },
   "page":{
      "u6b031ebfe46f46cd9ecdf430fa952f34":{
         "type":"component",
         ...
         ]
      },
      ...
      ...
      ...
      "u10811792bf4b42c4bbf1ab303fc5ebcf":{
         "type":"document",
         ...
      }
   }
}

Hierarchical structures such as the page component hierarchy or a navigation menu are serialized in a flattened representation.

See Page Delivery JSON Representation for a full walkthrough of the response format.

URL pattern

Any number of path elements can be appended to the base endpoint URL to retrieve the representation for the corresponding page in a channel.

Examples:

  • /delivery/site/v1/channels/brxsaas/pages/
  • /delivery/site/v1/channels/brxsaas/pages/products/tools/
  • /delivery/site/v1/channels/brxsaas/pages/articles/changing-a-tap-washer

Request headers

Request header Details
Authorization

When the Experience manager requests the preview channel for the first time, it appends the external frontend application's URL with a 'query' request parameter containing a JSON Web Token. In order to access the preview channel data through a Page Delivery API request, the frontend application must include this token in the Authorization header using the Bearer schema. See Page Delivery API Preview Authentication for more details.

Preview channel authentication is built into the Bloomreach SPA SDK. Channel preview works out of the box with any SPA built on the SDK. Only SPAs not using the SDK need to implement preview authentication

Value type

string

Required

Mandatory in Experience manager channel preview context only

Example value

Authorization: Bearer xxxxx.yyyyy.zzzzz

 

 

 

 

 

 

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?