Skip to content

Content

tkrami edited this page Jan 8, 2019 · 8 revisions
  • Type: contents
  • Path: /contents

Content entities contain all information of a page created in xamoom. Their content blocks are related entities and will only be included if you query for a content entity by id. Via the API you can only retrieves published content entities. Contentblocks are devlivered in included with the same ids as in relationships of the content.

Attributes

  • language - (String) Language of this content
  • languages - (Array) List of languages this content is available in
  • display-name - (String) Localized title of this content
  • description - (String) Localized description (excerpt) of this content
  • cover-image-url - (String, optional) Url of the content's cover image
  • category - (Int, optional) category of this content. (see -> Supported Categories)
  • tags - (Array, optional) List of this content's tags
  • custom-meta - (Array, optional) A language-independent list of Key-Value-Pairs with customer specific information about this object.
  • social-sharing-url - (String, optional) A url that should be shared (for example via Social Media) instead of this one.
  • created-at - (String, iso8601) ISO8601 formated date at which this content was created
  • updated-at - (String, iso8601) ISO8601 formated date at which this content was updated
  • meta-datetime-from - (String, iso8601, optional) ISO8601 formated date which indicates when this content is relevant. Only available if event package is activated.
  • meta-datetime-to - (String, iso8601, optional) ISO8601 formated date which indicates when this content is relevant. Only available if event package is activated.

Relationships

  • system - (System) The realtionship to the system this content belongs to.
  • blocks - (Array<ContentBlock>) Sorted List of ContentBlock relationships of this content. The content block entities are delivered in included.
  • spot - (Spot, optional) The spot that was used to access this content. Only given if this content was found via geofencing.
  • related-spot - (Spot, optional) A spot that is somehow related to this content. Only given if the user has activated the event package feature and also uses it on this content item.

Query Filters

  • location-identifier - Query for a content that is currently assigned to a spot via a marker's location-identifier. You should always include all Content Conditions parameters in queries for Content by Location Identifier Example: ../contents?filter[location-identifier]=asd345
  • lat - Latitude of center point for geofence search. Example: ../contents?filter[lat]=46.14
  • lon - Longitude of center point for geofence search. Example: ../contents?filter[lon]=14.112
  • radius - Radius in meters for geofence search. Only works if lat and lon are also set. Example: ../contents?filter[radius]=500
  • name - Fulltext search in names and tags. Example: ../contents?filter[name]=Awesome
  • tags - Search content items having given tags. Example: ../contents?filter[tags]=['tag1','tag2']
  • created-from - Search for content items that were created after given date (as ISO8601 date UTC). Example: ../contents?filter[created-from]=2017-05-25T17:26:01Z
  • created-to - Search for content items that were created before given date (as ISO8601 date UTC). Example: ../contents?filter[created-to]=2017-05-25T17:26:01Z
  • meta-from-datetime - Search for content items that have the meta timestamp from set to a date before given date (as ISO8601 date UTC). Example: ../contents?filter[meta-from-datetime]=2017-05-25T17:26:01Z
  • meta-to-datetime - Search for content items that have the meta timestamp to set to a date after given date (as ISO8601 date UTC). Example: ../contents?filter[meta-to-datetime]=2017-05-25T17:26:01Z
  • related-spot - Search for content items that have set their related spot to the given one. Example: ../contents?filter[related-spot]=123
  • recommend - This special query parameter, if set to true, will query for Content that is recommended for this user. It will at most return 10 items and paging as well as sorting is ignored, since it is sorted by how likely it is that this user is interessted in a certain item. This feature is one of the reasons, why you have to take care of the Ephemeral Id in your application. You need this to implement the recommendations list if the feature is active. To check if it is active get the Settings and check the is-recommendations-active attribute. Example: ../contents?recommend=true

Allowed Sort Expressions

  • name - Internal name of content entity. Example: ../contents?sort=name
  • created-at - Creation date. Example: ../contents?sort=created-at
  • updated-at - Last update date. Example: ../contents?sort=updated-at

Example Content Response

{
	"data": {
		"id": "123", 
		"type": "contents", 
		"attributes": {
			"language": "en", 
			"languages": ["de","en"], 
			"display-name": "My Test Page", 
			"description": "This is ther excerpt of this test page.", 
			"cover-image-url": "https://xamoom.com/wp-content/uploads/2017/03/x200.png", 
			"category": 49, 
			"tags": ["TEST","DEMO"], 
			"custom-meta": [
				{"key": "custome-field", "value": "custom value"},
				{"key": "custome-field-nr2", "value": "custom value number 2"}
			],
			"social-sharing-url": "https://please.share.this.url.com", 
			"created-at": "2016-12-11T19:19:38Z", 
			"updated-at": "2018-10-11T17:53:40Z",
			"meta-datetime-from": "2018-24-12T19:19:38Z", 
			"meta-datetime-to": "2018-26-12T17:53:40Z"
		}, 
		"relationships": {
			"blocks": {
					"data": [
						{"type": "contentblocks", "id": "789"},
						{"type": "contentblocks", "id": "7892"}
					]
			}, 
			"system": {
				"data": {
					"type": "systems", 
					"id": "456"
				}
			},
			"spot": {
				"data": {
					"type": "spots", 
					"id": "135"
				}
			},
			"related-spot": {
				"data": {
					"type": "spots", 
					"id": "246"
				}
			}
		}
	}, 
	"included": [
		{
			"id": "789", 
			"type": "contentblocks", 
			"attributes": {
				"block-type": 0, 
				"content-id": "None", 
				"content-list-sort-asc": false, 
				"content-list-tags": [], 
				"is-public": true, 
				"should-show-content-on-spotmap": false, 
				"spot-map-tags": [], 
				"text": "<p>This text can contain HTML.</p>", 
				"title": "This is a text block, because block-type == 0."
			}
		}, 
		{
			"id": "7892", 
			"type": "contentblocks", 
			"attributes": {
				"block-type": 6, 
				"content-id": "680", 
				"content-list-sort-asc": false, 
				"content-list-tags": [], 
				"is-public": true, 
				"should-show-content-on-spotmap": false, 
				"spot-map-tags": []
			}
		}
	]
}
You can’t perform that action at this time.