Content Request Reasons
This is very important! Please always use the right content reason on every request, in which you are retrieving a Content item . If we detect solutions that do not do this, we will deactivate them, because this would pollute the Analytics data of this customer and that is a bad thing. This also applies to the mobile SDKs. Some reasons are set by the SDK automatically, but some you have to set on your own. So keep that in mind, when implementing your application.
How it works
Every time you get a content by id - THIS DOES NOT APPLY TO QUERIES - you have to specify why you are doing this. In other words, the backend needs to know what you are going to do with this content. The good news is, that this is very easy to do. You just have to set the correct value of the ´X-Reason´ header on the request.
curl -X GET -H "Content-Type: application/json" -H "Apikey:YOUR-API-KEY" -H 'X-Reason: 3' "https://xamoom-217413.appspot.com/consumer/contents?id=A-VALID-CONTENT-ID&lang=de"
Available Reasons and when to use them
- 0 - Use this if you query for a content by id to show it in full in an app or mobile web client.
- 1 - Use this if you query for a content by by location identifier (like a QR id) to show it in full in an app or mobile web client.
- 2 - Use this if you query for a content by id to show it in full in another website. The Wordpress plugin, which is used to integrate content from the xamoom CMS into other websites uses this one on every request, for example.
- 3 - Use this if you query for a content to show just parts of it, like the title and maybe the excerpt, because you are showing a link to this content. Getting a content item for ContentBlock type 6, for example, requires you to set this reason.
- 4 - Use this if you query for a content to show a notification in an app or so. So, for example, if your app discovers an iBeacon and you need the content title in the notification, you have to query for this content using this reason.
- 5 - If a user opens a content item in your app, by opening an iBeacon notification and you have to load the content to show it in full, you have to use this reason.
- 6 - If your app has a list showing content items arroiund the user based on iBeacons in reach, you have to use this reason to query for the content items to show in this list.
- 7 - If you are saving a content item to an offline storage, you have to use this reason when retrieving the content.
- 8 - If you need to load a content item to show a menu that needs more than the information included in the menu response, you have to use this reason when retrieving the content.
- 21 - If you are implementing a voice assistant application (Alexa Skill, Google Assistant Action, and so on..), all of your content request have to use this reason.