7. Lightware REST API Reference
UCX series – User's Manual
72
Applied firmware package: v1.2.0b9 | LDC software: v2.5.10b1
POST Command with Basic Authentication Example
Switch video crosspoint
curl --user
<username>
:
<password>
-X POST -i
<ip>
/api/
<NodePath>
/
<PropertyName>
--data
<value>
C:\Users\Juca>
curl --user admin:pwrd -X POST -H -i http://192.168.0.110/api/V1/MEDIA/VIDEO/XP/switch --data I2:O1
OK
HTTPS Command Example 2.
Switch video crosspoint
curl -X POST -k -i
<ip>
/api/
<NodePath>
/
<PropertyName>
--data
<value>
C:\Users\Juca>
curl -X POST -k -i https://192.168.0.110/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: Sun, 28 May 2034 12:28:20 GMT
cache-control: max-age=86400,private
Server: lighttpd/1.4.56
OK
7.3.
Protocol Rules
7.3.1.
Command Structure Example
The examples below show, how to apply the REST API in different environments:
Curl in Command Line Terminal
ɯ
curl -X POST -i http://192.168.0.55/api/V1/MEDIA/VIDEO/XP/switch --data I2:O1
REST API Client in Mozilla
Method:
POST
URL:
http://192.168.0.55/api/V1/MEDIA/VIDEO/XP/switch
Body content type:
text/plain
Body:
I2:O1
7.3.2.
General Rules
▪
All names and parameters are case-insensitive.
▪
The methods, nodes and properties are separated by a slash (‘/’) character.
▪
The node name consists of letters of the English alphabet and numbers.
▪
All properties and methods are available HTTP(S) below /api as an URL.
▪
The HTTP server is available on port 80, the HTTPS server is available on port 443.
▪
GET / PUT/ POST methods are supported.
▪
Header contains the IP address (or hostname) and the nodepath.
▪
Arguments and property values should be given in the HTTP request’s body as a plain text.
▪
REST API - LW3 converter does escaping automatically.
▪
The node paths describe the exact location of the node, listing each parent node up to the root.
▪
The supported HTTP protocol: standard HTTP/1.1
▪
There is no maxiumum size or character length of the request.
header:
POST http://192.168.0.50/api/V1/MEDIA/VIDEO/XP/switch HTTP/1.1
body:
I2:O1
header:
200 OK
Part of the HTTP structure
Request
HTTP method
(GET/POST/PUT)
IP address or hostname of
the target device
Response
Part of the HTTP structure
Nodepath
Supported HTTP
version
Method
/property
HTTP status code
Value of the property/method