Skip to content
Bruno Hautzenberger edited this page Nov 29, 2018 · 6 revisions

The xamoom CMS allow the user to add more than just the default Content to a Spot. This is done using so called Content Conditions. If a Conditions is true the Spot will return the Content specified for this condition and not the default one. This only works if you query for content by location identifier.

Server-Side Conditions

These conditions are resolved by the backend, so you as a frontend developer do not have to send any client-side information to server to make them work. The only thing that you have to, and you have to do that anyway, is to tka care of the Ephemeral Id in your requests to the backend.

Server-Side Conditions are:

  • visits today
  • visits this week
  • visits this month
  • visits all time
  • visits last three days
  • visits last seven days
  • visits last thirty days

Client-Side Conditions

These conditions require you as a developer to send condition values in addition to filter[location-identifier] as query parameters in the content query. Per default there is only one condition that should always be send to the API on every Content by location identifier query, which is x-datetime and the value has to be the current date and time of the user converted to UTC. Example: GET .../contents?condition[x-datetime]=2018-11-29T13:37:23Z&filter[location-identifier]=123abc&lang=de

If you are using the SDK for Android or iOS 'x-datetime' is set automatically by the SDK. You only need to do this if you are using the API directly.

In addition you can specify any client side condition you need for your solution. Use this feature if you want to react to things your app knows about your user, but the xamoom backend doesn't. For example, if you offer a login in your app and you have access to your user's age, you could send this value as a condition value to the backend where you use your condition name in a Conternt Condition on a Spot to serve different content based on age. All Conditions have to be send as query parasmters like this: condition[**YOUR-CONDITION-NAME**]=**THE-VALUE**

To go on with the age-example this could look something like this: Example: GET .../contents?condition[age]=24&condition[x-datetime]=2018-11-29T13:37:23Z&filter[location-identifier]=123abc&lang=de

The SDKs for Android and iOS offer parameters in the methods to get Content by location identifier, which makes this a lot easier for you and you do not have to take care of the raw query parameters yourself.