UCX series – User's Manual 71
Terminal Application
The REST API requests can be applied to the switcher using a terminal application. You need to install one
#terminal
Curl
Curl
in a terminal window. It supports data transferring with HTTP and HTTPS standards and handles the basic
®
Check if the Curl package is installed on your system. Type your console: curl. '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
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