![Lightware UCX-2x1-HC30 Скачать руководство пользователя страница 74](http://html1.mh-extra.com/html/lightware/ucx-2x1-hc30/ucx-2x1-hc30_user-manual_1915482074.webp)
7. Lightware REST API Reference
UCX series – User's Manual
74
Applied firmware package: v1.2.0b9 | LDC software: v2.5.10b1
7.3.7.
Not Supported Commands
Query node (GET)
Protocol
Command
Note
REST API
Not supported
404 error code
LW3
ç
GET·
/
<NODEPATH>
Example
ç
GET /V1/MEDIA/VIDEO
Subscribe to a node (OPEN)
Protocol
Command
Note
REST API
Not interpreted
Not supported
LW3
ç
OPEN·/
<NODEPATH>
Example
ç
OPEN /V1/MEDIA/VIDEO
Unsubscribe from a Node (CLOSE)
Protocol
Command
Note
REST API
Not interpreted
Not supported
LW3
ç
CLOSE·/
<NODEPATH>
Example
ç
CLOSE /V1/MEDIA/VIDEO
7.3.8.
Status Codes, Error Messages
The standard HTTP response codes are defined to supply information about the response and the executed
command like:
Error code
Description
200
OK
Standard response for successful HTTP request.
401
Unauthorized
405
Method Not Allowed
A request method is not supported for the requested resource. This is
the error code when trying to modify a read-only property.
404
Not Found
Invalid nodepath or property name.
406
Not Acceptable
LW3 server error response for POST and PUT method, e
quals the
following LW3 error codes:
pE:
an error for the property
mE:
an error for a method
500
Internal Server Error
All other errors (Lw3ErrorCodes_InternalError).
7.3.9.
Polling
Subscription and unsubscription features are not supported, they can be substituted with polling. It means
that a custom user script sends a request for a detected property from time to time.
7.4.
REST API Security
The REST API is designed with two security features:
Authentication
and
Encryption.
Both of them are optional
and can be used independently from each other.
7.4.1.
Authentication
Basic access authentication is designed to limit user access for the REST API server. It requires user
authentication by using password (username is fixed).
Follow the instructions below to set the password:
Step 1.
Set the password.
ɯ
header: POST·
<ip>
/api/V1/MANAGEMENT/NETWORK/AUTHENTICATION/setPassword
·
HTTP/1.1
ɯ
body:
<new_password>
Step 2.
Enable the basic authentication on the chosen port (HTTP: 80 or HTTPS: 443).
ɯ
header:
POST·
<ip>
/api/V1/MANAGEMENT/NETWORK/SERVICES/HTTP/AuthenticationEnabled
·
HTTP/1.1
ɯ
body: true
Step 3.
Restart network services.
ɯ
header:
POST·
<ip>
/api/V1/MANAGEMENT/NETWORK/SERVICES/HTTP/restart
·
HTTP/1.1
ATTENTION!
The password will not be encrypted by this authentication mode, it remains accessible when
the communication happens on HTTP.
For more details, see
section.
7.4.2.
Encryption (HTTPS)
There is no encryption when the REST API communication happens via HTTP, because the HTTP protocol
is not encrypted. The REST API server is available via HTTPS on the 443 port. To avoid the data interception
(e.g. stealing the password) HTTP should be disabled and HTTPS protocol used instead.
ATTENTION!
Please ensure proper UCX time and date setting in UCX because it affects the self-signed
certificate (SSL) generation when using WSS or HTTPS. Improper time and date setting may lead to
certificate rejection.
HTTPS does not guarantee that the communication is secure. Make sure that the client communicates with
the server directly, without any third-party element in the communication route (Man-in-the-middle attack).
For more details, see
section.