Content Items - Bloomreach Experience - The Headless Digital Experience Platform Built for Commerce

Content Items

Document JSON representation

A serialized document typically has a format like the example below. There is the type field, the links containing information about the URL and whether it is internal or external to the current SPA, meta which can contain document information typically only needed for the channel preview in the Experience manager, and the data section containing the actual contents of the document. If the document contains references to other documents, image sets or assets, they also get serialized flattened, as shown for the image field below.

{
   "type":"document",
   "links":{
      "site":{
         "href":"/news/2015/08/2013-harvest.html",
         "type":"internal"
      }
   },
   "meta":{
      
   },
   "data":{
      "name":"2013-harvest",
      "displayName":"2013 harvest",
      "date":1440571980000,
      "source":"",
      "title":"2013 harvest",
      "introduction":"Lorem ipsum dolor sit amet",
      "author":"Alfred Anonymous",
      "image":{
         "$ref":"/page/ubeff458ee07a40658cad8d96b67d13ec"
      },
      "location":"Rome",
      "content":{
         "value":" <p>Lorem ipsum dolor sit amet</p> "
      },
      "localeString":"en",
      "id":"30092f4e-2ef7-4c72-86a5-8ce895908937"
   }
}

Component content JSON representation

Component content is content embedded in a page-specific component. Its serialized format is very similar to that of a document:

"u1bf91159f6984d889b3fed621b5dbe55":{
    "type":"componentcontent",
    "data":{
        "name":"titleandtext-a1b1",
        "displayName":"titleandtext-a1b1",
        "text":{
            "contentType":"hippostd:html",
            "value":"<p>Lorem ipsum dolor sit amet</p>"
        },
        "title":"Welcome to brX Content",
        "contentType":"brxsaas:titleandtext"
    }
}

Image set JSON representation

Image sets are serialized as type 'imageset' and have all the different image variants serialized including the URL to retrieve them, for example:

    "udb02dde500984488a72c2a4fc6d51beb" : {
      "type" : "imageset",
      "links" : { },
      "meta" : { },
      "data" : {
        "name" : "picture.jpeg",
        "displayName" : "picture.jpeg",
        "description" : null,
        "original" : {
          "name" : "hippogallery:original",
          "displayName" : "hippogallery:original",
          "width" : -1,
          "height" : -1,
          "lastModified" : 1236880917884,
          "mimeType" : "image/jpeg",
          "filename" : "picture_original.jpeg",
          "size" : 168981,
          "links" : {
            "site" : {
              "href" : "http://localhost/site/binaries/unittestcontent/gallery/picture.jpeg",
              "type" : "resource"
            }
          }
        },
        "thumbnail" : {
          "name" : "hippogallery:thumbnail",
          "displayName" : "hippogallery:thumbnail",
          "width" : -1,
          "height" : -1,
          "lastModified" : 1236880917884,
          "mimeType" : "image/jpeg",
          "filename" : "picture_thumbnail.jpeg",
          "size" : 1490,
          "links" : {
            "site" : {
              "href" : "http://localhost/site/binaries/thumbnail/unittestcontent/gallery/picture.jpeg",
              "type" : "resource"
            }
          }
        },
        "fileName" : null,
        "localeString" : null,
        "id" : "db02dde5-0098-4488-a72c-2a4fc6d51beb"
      }
    }

Pagination JSON representation

Document query components have a search result-like pagination model containing:

  1. A list of actual results for the current page

  2. How many results there are

  3. How many items are on a pages

  4. How many pages there are

  5. What the current page is 

The pagination object gets serialized flattened. Its structure looks as follows and the JSON references the items point to the actual content items which are also serialized flattened in the response:

    "uid7": {
      "offset": 0,
      "items": [
        {
          "$ref": "/page/u7467739e33b84a35b6b31659eb90fc67"
        },
        {
          "$ref": "/page/u5b49b58f903d4a91823a1b00fbabbf66"
        },
        {
          "$ref": "/page/uc28bf4536f834377a2ab219e6f71e72c"
        },
        {
          "$ref": "/page/u3046c7d1d14c42e9b13aa96d3c1ba819"
        },
        {
          "$ref": "/page/u9decc66350a340c3820cd6feaf06bab3"
        },
        {
          "$ref": "/page/ud94d39a9badb45419bf65d23e10f0aa3"
        }
      ],
      "total": 58,
      "first": {
        "number": 1,
        "links": {
          "site": {
            "href": "?r22_r1_r4:page=1&r22_r1_r4:limit=3",
            "type": "internal"
          },
          "self": {
            "href": "http://localhost/site/resourceapi?r22_r1_r4:page=1&r22_r1_r4:limit=3",
            "type": "external"
          }
        }
      },
      "previous": null,
      "current": {
        "number": 1,
        "links": {
          "site": {
            "href": "?r22_r1_r4:page=1&r22_r1_r4:limit=3",
            "type": "internal"
          },
          "self": {
            "href": "http://localhost/site/resourceapi?r22_r1_r4:page=1&r22_r1_r4:limit=3",
            "type": "external"
          }
        }
      },
      "next": {
        "number": 2,
        "links": {
          "site": {
            "href": "?r22_r1_r4:page=2&r22_r1_r4:limit=3",
            "type": "internal"
          },
          "self": {
            "href": "http://localhost/site/resourceapi?r22_r1_r4:page=2&r22_r1_r4:limit=3",
            "type": "external"
          }
        }
      },
      "last": {
        "number": 10,
        "links": {
          "site": {
            "href": "?r22_r1_r4:page=10&r22_r1_r4:limit=3",
            "type": "internal"
          },
          "self": {
            "href": "http://localhost/site/resourceapi?r22_r1_r4:page=10&r22_r1_r4:limit=3",
            "type": "external"
          }
        }
      },
      "pages": [
        {
          "number": 1,
          "links": {
            "site": {
              "href": "?r22_r1_r4:page=1&r22_r1_r4:limit=3",
              "type": "internal"
            },
            "self": {
              "href": "http://localhost/site/resourceapi?r22_r1_r4:page=1&r22_r1_r4:limit=3",
              "type": "external"
            }
          }
        },
        {
          "number": 2,
          "links": {
            "site": {
              "href": "?r22_r1_r4:page=2&r22_r1_r4:limit=3",
              "type": "internal"
            },
            "self": {
              "href": "http://localhost/site/resourceapi?r22_r1_r4:page=2&r22_r1_r4:limit=3",
              "type": "external"
            }
          }
        },
        {
          "number": 3,
          "links": {
            "site": {
              "href": "?r22_r1_r4:page=3&r22_r1_r4:limit=3",
              "type": "internal"
            },
            "self": {
              "href": "http://localhost/site/resourceapi?r22_r1_r4:page=3&r22_r1_r4:limit=3",
              "type": "external"
            }
          }
        }
      ],
      "size": 6,
      "enabled": true
    }

 

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?