HTTP API

From DISE KnowledgeBase

Jump to: navigation, search

Overview

DISE Replay comes with an builtin web server. The server provides information and control by a standard REST format. To access a player using the HTTP API:

In the HTTP API, requests that you send to the player either by GET or some other HTTP method. GET requests are generally information about the state of the player, whereas POST or PUT lets you control the playback. When you make a POST or PUT command, make sure the "Content-Type" header is set to "text/xml" ("Content-Type: text/xml")

For the examples given below, we are using curl.

Command specification

/api/

Root folder for the API. Here you get a list of the API functions that are registered.

  • GET - Retrieve list of API functions

/api/Replay/

Communication with DISE Replay. Several instances of Replay on the same player can be controlled by the API - we therefore need to indicate to which instance of Replay to send. This page gives us a list of the Replays on the player and their software ID. Use this ID for all subsequent requests to Replay.

  • GET - Retrieve list of Replays and their software IDs.

/api/Replay/[ID]

When we refer to "[ID]", it is the software ID that needs to be specified (see above for how to get the software ID). An example: {DC61460D-37BD-420F-B859-F21E25B2BC82}. When making a HTTP request, the { and } need to be replaced with %7B and %7D, respectively, making it: %7BDC61460D-37BD-420F-B859-F21E25B2BC82%7D.

  • GET - Basic information (settings, display schemes, etc)
Response format (GET)

Example.png XML:

<Replay>
   <Instance name="[ID]">
      <FriendlyName>[Replay-name]</FriendlyName>
      <DisplayScheme>[path-to-displayscheme]</DisplayScheme>
   </Instance>
</Replay>

/api/Replay/[ID]/Playback

  • GET - Gets the playback status (stopped, playing, pause, display scheme, forward, backward)
  • PUT - Send a command to the playback engine (play, stop, pause, forward, backward)

Lightbulb.png Note: This command will be sent to all channels. To effect only one channel, see /api/Replay/[ID]/Playback/Channel/[channel-name] below.

Request format (PUT)

Example.png XML:

<Request>
   <Playback>
     <Command>[Play|Stop|Pause|Forward|Backward]</Command>
   </Playback>
 </Request>

Send command to pause (using curl)

Example.png Example:

curl -H "Content-Type:text/xml" -X PUT --data "<Request><Playback><Command>Pause</Command></Playback></Request>" \
http://localhost:8080/api/Replay/%7BDC61460D-37BD-420F-B859-F21E25B2BC82%7D/Playback/

/api/Replay/[ID]/Playback/Channel

Channel management

  • GET - List channels

/api/Replay/[ID]/Playback/Channel/[channel-name]

command of the selected channel

  • GET - Lists information about the channel with the name channel-name.
  • PUT - Send a command (to play, stop, pause, unpause, loop current scene, restart current scene, forward, backward) the channel with the name channel-name.
Request format (PUT)

Example.png XML:

<Request>
   <Playback>
     <Channel>     
       <Command>[Play|Stop|Pause|Unpause|LoopScene|RestartScene|Forward|Backward]</Command>
     </Channel>
   </Playback>
 </Request>

Send channel "News" a command to go forward one scene (using curl)

Example.png Example:

curl -H "Content-Type:text/xml" -X PUT --data "<Request><Playback><Channel><Command>Forward</Command></Channel></Playback></Request>" \
http://localhost:8080/api/Replay/%7BDC61460D-37BD-420F-B859-F21E25B2BC82%7D/Playback/Channel/News

/api/Replay/[ID]/DisplayScheme

Request format (PUT)

Example.png XML:

<Request>
   <DisplayScheme>[path-to-displayscheme]</DisplayScheme>
 </Request>

Set the current playing content (using curl)

Example.png Example:

curl -H "Content-Type:text/xml" -X PUT --data "<Request><DisplayScheme>C:\DISEContent\Destinations\Default\Player1.displayscheme</DisplayScheme></Request>" \
http://localhost:8080/api/Replay/%7BDC61460D-37BD-420F-B859-F21E25B2BC82%7D/DisplayScheme

/api/Replay/[ID]/Screenshot

  • GET - Get the current playing screenshot.
The following GET parameters can be sent along with the Screenshot request:
  • width
The width of the screenshot, in pixels. When this is set, the height will be set automatically to keep the aspect ratio.
  • height
The height of the screenshot, in pixels.
Get a 200 pixels wide thumbnail screenshot

Example.png Example:

curl -X GET http://localhost:8080/api/Replay/%7BDC61460D-37BD-420F-B859-F21E25B2BC82%7D/Screenshot?width=200

/api/Replay/[ID]/Log

  • GET - Get the latest log information.

/api/Replay/[ID]/PerformanceMonitor

  • GET - Get some performance information.

/api/Replay/[ID]/OSD

  • GET - Get information about the On Screen Display.
  • PUT - Set On Screen Display settings.
Request format (PUT)

Example.png XML:

<Request>
   <OSD>
     <OSDLevel>1</OSDLevel>
     <OSDColor>255</OSDColor>
  </OSD>
 </Request>

Show the OSD page with playback information (using curl)

Example.png Example:

curl -H "Content-Type:text/xml" -X PUT --data "<Request><OSD><OSDLevel>2</OSDLevel></OSD></Request>" \
http://localhost:8080/api/Replay/%7BDC61460D-37BD-420F-B859-F21E25B2BC82%7D/OSD

/api/Replay/[ID]/AvailableContent

  • GET - List the available content.

/api/Replay/[ID]/LocalUpload

  • POST - Upload an image to the playback.

/api/Replay/[ID]/Variables

/api/Replay/[ID]/Variables/[variable-name]

  • PUT - Set a variable with the name variable-name.
  • DELETE - Remove the variable variable-name.
Request format (PUT)

Example.png XML:

<Request>
   <[variable-name] Persistent="true">
     Value
  </[variable-name]>
 </Request>

Variable management (using curl)

Example.png Add variable:

curl -H "Content-Type:text/xml" -X PUT --data "<Request><MyVar Persistent='false'>Value</MyVar></Request>" \
http://localhost:8080/api/Replay/%7BDC61460D-37BD-420F-B859-F21E25B2BC82%7D/Variables/MyVar

Example.png Delete variable:

curl -X DELETE http://localhost:8080/api/Replay/%7BDC61460D-37BD-420F-B859-F21E25B2BC82%7D/Variables/MyVar

/api/Probe/

Communication with DISE Probe. This page gives us a list of the Probes on the player and their software ID. Use this ID for all subsequent requests to Probe.