Skip to content
Bruno Hautzenberger edited this page Nov 29, 2018 · 3 revisions
  • Type: menus
  • Path: /menus

Menu entities contain relationships to all menu items. These are all Content items to link to. You can only get the Menu of the System of the API key you are using. You can not query for Menus, just get yours by id. The id of your Menu can be found in the relationships of your System. Do never hardcode this id, always get the system using your API key and get all ids you need from there.

Attributes

  • nearby-index - (Int, optional) The position in the menu on which your frontend should show a menu item to get the user to a page that shows what is close to him. Use a Spot query with the user's location and a radius, sorted by distance, to get the content items attached to them.

Relationships

  • items - (Array<Content>) Sorted menu items - content items. A shortened version of these content items, with only the data needed for a menu, can also be found in the included part of this response object.

Example Menu Response

{
	"data": {
		"id": "309", 
		"type": "menus", 
		"attributes": {
			"nearby-index": 4
		}, 
		"relationships": {
			"items": {
				"data": [
						{
							"type": "contents", 
							"id": "123"
						}, 
						{
							"type": "contents", 
							"id": "456"
						}, 
					]
			}
		}
	}, 
	"included": [
			{
				"id": "123", 
				"type": "contents", 
				"attributes": {
					"category": 42, 
					"description": "This content is the first in the menu", 
					"display-name": "Welcome", 
					"language": "en"
				}
			}, 
			{
				"id": "456", 
				"type": "contents", 
				"attributes": {
					"category": 49, 
					"description": "This content is the second in the menu", 
					"display-name": "Some other content", 
					"language": "en"
				}
			}
	]
}
You can’t perform that action at this time.