Sie sehen sich Hilfeinhalte der folgenden Version an:
- 6.4
- Ältere Versionen
AEM Screens stellt eine einfache RESTful-API bereit, die der Siren-Spezifikation entspricht. Sie ermöglicht die Navigation in der Inhaltsstruktur und das Senden von Befehlen an Geräte in der Umgebung.
Die API steht unter http://localhost:4502/api/screens.json zur Verfügung.
Die von den API-Aufrufen zurückgegebene JSON-Datei listet die Entitäten auf, die im Zusammenhang mit der aktuellen Ressource stehen. Nach dem aufgeführten Selbstlink kann auf jede dieser Entitäten wieder als REST-Ressource zugegriffen werden.
Um beispielsweise auf die Bildschirme an unserem Demo-Flagship-Standort zuzugreifen, können Sie Folgendes aufrufen:
GET /api/screens/content/screens/we-retail/locations/demo/flagship.json HTTP/1.1 Host: http://localhost:4502
curl -u admin:admin http://localhost:4502/api/screens/content/screens/we-retail/locations/demo/flagship.json
{ "class": [ "aem-io/screens/location" ], "links": [ { "rel": [ "self" ], "href": "http://localhost:4502/api/screens/content/screens/we-retail/locations/demo/flagship.json" }, { "rel": [ "parent" ], "href": "http://localhost:4502/api/screens/content/screens/we-retail/locations/demo.json" } ], "properties": {…}, "entities": [ { "class": [ "aem-io/screens/display" ], "links": [ { "rel": [ "self" ], "href": "http://localhost:4502/api/screens/content/screens/we-retail/locations/demo/flagship/single.json" } ], "rel": [ "child" ], "properties": { "title": "Single Screen Display", "height": 1440, "description": "Demo location of a single screen display.", "name": "single", "width": 2560, "idletimeout": 300, "layoutrows": 1, "layoutcols": 1 } }, … ] }
GET /api/screens/content/screens/we-retail/locations/demo/flagship/single.json HTTP/1.1 Host: http://localhost:4502
Die von den API-Aufrufen zurückgegebene JSON-Datei kann eine Liste von Aktionen enthalten, die für die Ressource verfügbar sind.
Auf dem Bildschirm wird beispielsweise eine broadcast-command-Aktion auf, die es ermöglicht, einen Befehl an alle diesem Bildschirm zugeordneten Geräte zu senden.
GET /api/screens/content/screens/we-retail/locations/demo/flagship/single.json HTTP/1.1 Host: http://localhost:4502
curl -u admin:admin http://localhost:4502/api/screens/content/screens/we-retail/locations/demo/flagship/single.json
{ "class": [ "aem-io/screens/display" ], "links": […], "properties": {…}, "entities": […], "actions": [ { "title": "", "name": "broadcast-command", "method": "POST", "href": "/api/screens/content/screens/we-retail/locations/demo/flagship/single", "fields": [ { "name": ":operation", "value": "broadcast-command", "type": "hidden" }, { "name": "msg", "type": "text" } ] } ] }
POST /api/screens/content/screens/we-retail/locations/demo/flagship/single.json HTTP/1.1 Host: http://localhost:4502 :operation=broadcast-command&msg=reboot
curl -u admin:admin -X POST -d ':operation=broadcast-command&msg=reboot' http://localhost:4502/api/screens/content/screens/we-retail/locations/demo/flagship/single.json