๎๎๎๎ฐ๎๎๎๎๎๎
๎๎๎๎ถ๎ฉ๎ท๎ธ๎๎ฅ๎ด๎ญ๎๎ถ๎๎๎๎๎๎๎๎๎ ๎ฑ๎ฑ๎ผ๎๎๎๎๎๎๎๎๎๎ฉ๎๎น๎๎๎๎๎๎๎ฑ๎
๎๎๎
๎๎ ๎๎
๎ฅ๎๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎๎
๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎๎๎ ๎๎ฐ๎จ๎ง๎๎๎๎๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎๎ฃProtocol Rules
๎๎๎๎๎๎๎ฃCommand Structure Example
The examples below show how to apply the REST API in different environments:
Curl in Command Line Terminal
ษฏ ๎๎๎๎๎๎๎ผ๎๎ด๎ณ๎ท๎ธ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎บ๎๎๎ฑ๎ฉ๎จ๎ญ๎ฅ๎๎บ๎ญ๎จ๎ฉ๎ณ๎๎ผ๎ด๎๎๎๎๎๎๎๎๎๎๎๎
๎๎
๎๎ญ๎๎๎ณ๎
REST API Client in Mozilla
Method: POST
URL:๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎บ๎๎๎ฑ๎ฉ๎จ๎ญ๎ฅ๎๎บ๎ญ๎จ๎ฉ๎ณ๎๎ผ๎ด๎๎๎๎๎๎๎๎
Body content type:๎๎๎๎๎๎๎๎๎
๎๎๎
Body: I2:O1
๎๎๎๎๎๎๎ฃGeneral Rules
โช All names and parameters are case-insensitive.
โช ๎ธ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎๎๎๎
๎๎
๎๎๎๎๎๎๎๎
๎๎๎๎
๎๎๎๎๎ฌ๎๎ญ๎๎๎๎๎
๎๎
๎๎๎๎๎
โช The node name consists of letters of the English alphabet and numbers.
โช ๎ฅ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎
๎๎
๎๎๎
๎๎๎๎๎ฌ๎ธ๎ธ๎ด๎๎ท๎๎๎๎๎๎๎๎๎๎
๎๎๎๎
๎๎๎
๎๎๎น๎ถ๎ฐ๎
โช ๎ธ๎๎๎๎ฌ๎ธ๎ธ๎ด๎๎๎๎๎๎๎๎๎๎๎๎
๎๎
๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎ฌ๎ธ๎ธ๎ด๎ท๎๎๎๎๎๎๎๎๎๎๎๎
๎๎
๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
โช ๎ซ๎ฉ๎ธ๎๎๎๎ด๎น๎ธ๎๎๎ด๎ณ๎ท๎ธ๎๎๎๎๎๎๎๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎๎
โช 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.
โช ๎ถ๎ฉ๎ท๎ธ๎๎ฅ๎ด๎ญ๎๎๎๎ฐ๎ป๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎๎๎
๎๎๎๎๎
๎๎๎๎
๎๎๎๎
โช The node paths describe the exact location of the node, listing each parent node up to the root.
โช ๎ธ๎๎๎๎๎๎๎๎๎๎๎๎๎๎ฌ๎ธ๎ธ๎ด๎๎๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎
๎๎๎๎ฌ๎ธ๎ธ๎ด๎๎๎๎
โช 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
version
Method
/property
Value of the property/method
๎๎๎๎๎๎๎ฃLegend for the Control Commands
Command and Response โ Example
ษฏ header: GETยท<ip>๎๎
๎๎๎๎บ๎๎๎ฑ๎ฉ๎จ๎ญ๎ฅ๎๎บ๎ญ๎จ๎ฉ๎ณ๎<in>๎๎ท๎๎๎๎
๎๎ด๎๎๎๎๎๎๎ธ๎ฌ๎ธ๎ธ๎ด๎๎๎๎
ษฎ body: <status code>
Format Description
<ip> IP address or hostname of the target device
<in> Input port number
<out> Output port number
<port> Input or output port number
<loc> ๎ฐ๎๎๎
๎๎๎๎๎๎๎๎๎๎๎
<parameter> ๎บ๎
๎๎๎
๎๎๎๎๎๎๎ค๎๎๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
๎๎
<expression>
Batched parameters: the underline means that more
expressions or parameters can be placed by using a
semicolon, e.g. I2;I4 or F27:E1;F47:E2
ษฏ
Sent request
ษฎ
Received response
ยท Space character
Further, not listed <parameters>๎๎
๎๎๎๎๎๎ค๎๎๎๎๎
๎๎๎๎
๎๎๎๎๎๎๎๎
๎๎๎๎
๎๎๎๎๎๎๎ฃLightware REST API vs. LW3 Protocol
๎ฅ๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎ฐ๎ป๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎
๎๎๎๎๎๎๎๎๎๎
๎๎๎๎
๎๎๎
๎๎ฌ๎ธ๎ธ๎ด๎๎๎๎๎น๎ถ๎ฐ๎๎๎ธ๎๎๎๎๎๎๎
๎๎
๎๎๎๎
character is always a ๎๎๎
๎๎๎๎๎ฌ๎๎ญ๎๎๎๎๎
๎๎
๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎ธ๎๎๎๎น๎ถ๎ฐ๎๎๎๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
Example
๎ธ๎๎๎๎ฐ๎ป๎๎๎๎๎๎๎๎๎๎๎
๎๎๎บ๎๎๎ฑ๎ฉ๎จ๎ญ๎ฅ๎๎บ๎ญ๎จ๎ฉ๎ณ๎๎ญ๎๎๎ฅ๎๎๎๎๎๎ถ๎๎๎๎๎๎๎๎๎
Available in REST API:
๎๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎บ๎๎๎ฑ๎ฉ๎จ๎ญ๎ฅ๎๎บ๎ญ๎จ๎ฉ๎ณ๎๎ญ๎๎๎ฅ๎๎๎๎๎๎ถ๎๎๎๎๎๎๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎๎ฅ๎ด๎ญ๎๎๎๎๎๎๎๎๎
๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
๎ธ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
๎๎๎๎๎๎๎
๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎ถ๎ฉ๎ท๎ธ๎๎ฅ๎ด๎ญ๎๎๎๎๎๎๎๎๎๎๎๎๎๎ฐ๎ป๎๎๎๎๎๎๎๎๎๎๎
โช Sending a Message via RS-232
๎ธ๎๎๎ ๎๎๎๎๎ ๎๎๎๎๎๎๎
๎๎๎ ๎๎๎๎๎
๎๎๎๎ ๎
๎๎๎ ๎๎๎๎๎๎๎ ๎๎๎ ๎๎๎๎๎ ๎๎๎
๎๎๎๎๎๎ ๎ณ๎๎๎๎๎ ๎๎๎๎๎
๎๎๎๎ ๎๎
๎๎ ๎๎๎ ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎ ๎ฐ๎ป๎๎
tree structure, where the read-only (eg. pr๎ ๎๎บ๎๎๎ฑ๎ฉ๎จ๎ญ๎ฅ๎๎บ๎ญ๎จ๎ฉ๎ณ๎๎ญ๎๎๎ง๎๎๎๎๎๎๎๎๎๎ ๎
๎๎๎ ๎๎๎
๎๎๎๎๎๎๎๎ ๎๎๎๎๎๎๎๎๎๎๎
(pw๎ ๎๎บ๎๎๎ฑ๎ฉ๎จ๎ญ๎ฅ๎๎บ๎ญ๎จ๎ฉ๎ณ๎๎ญ๎๎๎ฒ๎
๎๎๎๎ ๎๎
๎๎ ๎๎๎ ๎๎๎๎๎๎๎๎ ๎ช๎๎๎ ๎๎๎๎๎ ๎๎๎๎
๎๎๎๎ ๎
๎๎๎๎๎ ๎ฐ๎ป๎๎ ๎๎๎๎๎ ๎๎๎๎๎๎๎๎๎๎๎ ๎๎๎๎ ๎๎๎๎
๎ฐ๎ป๎๎๎ด๎๎๎๎๎
๎๎๎๎๎๎ญ๎๎ถ๎๎๎๎๎๎๎๎ section or the๎๎ฅ๎๎๎
๎๎๎๎๎๎บ๎๎๎๎๎ป๎๎๎๎๎๎