Localized Content based on Dimensions

When querying Entities through the Loyalty API, any CMS content is localized based on the Dimensions passed in to the query.

Let's say that a Game has got a title that we want to display on a website. The game is called 'Space War' in English, and 'Rymdkrig' in Swedish.

When we create the Game Entity we add a CMS attribute called 'title'. The Json for this is:

"cmsContent": {
      "title": {
      "value": "Space War",
      "localisations": [
        {
          "dimensionFilter": {
            "country": "SV"
          },
          "value": "Rymdkrig"
        }
      ]
    }
}

When querying all Games on the website we call the Loyalty API with GET /games?dim=country:SV.

The API will go through all CMS content localizations to find a match to the passed in Dimensions, and return the first value it finds. If none of the localizations match then the default value is returned. The response, will therefore simply contain:

"cmsContent": {
  "title": "Rymdkrig"
}