7. Lightware REST API Reference
UCX series – User's Manual
71
Applied firmware package: v1.2.0b9 | LDC software: v2.5.10b1
7.2.2.
Terminal Application
The REST API requests can be applied to the switcher using a terminal application. You need to install one
of them to your control device, for example, Putty, CLI or Curl.
#terminal
Curl
Curl
is a command line tool which can also connect to the Taurus REST SERVER and display communication
in a terminal window. It supports data transferring with HTTP and HTTPS standards and handles the basic
authentication (username and password) in Windows
®
and Linux operating systems. Multi-line commands
are also accepted, so a script can be stored in a .txt file for future reference.
Check if the Curl package is installed on your system. Type your console:
curl.
When the answer is
'curl:
try 'curl --help' for more information'
, curl is installed.
Some web browser plugins (e.g. REST Client) display the curl version of the sent request.
Once the terminal window is opened, you can enter the commands. Some typical examples are listed in the
following section.
REST API communication in a command line window
GET Command
Example
Query the Signal Presence
curl -i -X GET
<ip>
/api/
<NodePath>
/
<PropertyName>
C:\Users\Juca>
curl -i -X GET http://192.168.0.55/api/V1/MEDIA/VIDEO/XP/I2/SignalPresent
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 5
ETag: W/"5-fLbvuYullyqbUJDcLlF/4U0SywQ"
Date: Sat, 13 May 2034 13:39:24 GMT
cache-control: max-age=86400,private
Server: lighttpd/1.4.56
false
POST Command Example 1.
Set the Mute State
curl -X POST -i
<ip>
/api/
<NodePath>
/
<PropertyName>
--data
<value>
C:\Users\Juca>
curl -X POST -i http://192.168.0.55/api/V1/MEDIA/VIDEO/XP/I2/Mute --data true
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: text/html; charset=utf-8
Content-Length: 5
ETag: W/"5-hg914ZeUflab5o9bn2uUeaPo3CI"
Date: Sat, 13 May 2034 13:48:09 GMT
cache-control: max-age=86400,private
Server: lighttpd/1.4.56
true
POST Command Example 2.
Switch video crosspoint
curl -X POST -i
<ip>
/api/
<NodePath>
/
<PropertyName>
--data
<value>
C:\Users\Juca>
curl -X POST -i http://192.168.0.55/api/V1/MEDIA/VIDEO/XP/switch --data I2:O1
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: text/plain; charset=utf-8
Content-Length: 2
ETag: W/"2-nOO9QiTIwXgNtWtBJezz8kv3SLc"
Date: Sat, 13 May 2034 14:02:01 GMT
cache-control: max-age=86400,private
Server: lighttpd/1.4.56
OK