Real Time Automation, Inc.
41
1-800-249-1612
Web Interface: XML/JSON Data Format
1)
XML
–
For simplicity, the web interface uses a “flat” XML encoding format. The root XML
element is always
<Devices>
followed by one or more
<Device>
elements, which will in turn
contain name-value pairs with the data relevant to that device.
2)
JSON
–
The format of JSON is very simplistic. Data is contained in a single array of zero or more
objects, each representing a
device.
Each object contains one or more name/value pairs within
the device.
Retrieving Data from the Gateway from a Web Client
XML and JSON data accessed from the 460WI using web client is handled via a standard HTTP
GET
request. Which data is to be accessed and how that data is to be encoded is all determined by the URL
supplied with the GET request. This is the same method through which web browsers retrieve web
pages so you can use the web browser of your choice to experiment with different requests by simply
typing the URL into the browser’s addr
ess bar and hitting enter.
Basics
To begin, you will need to know the IP address of your 460WI Gateway. If you do not know the IP
address, refer to Accessing the Main Page Section. The examples in this document will use 192.168.0.1
for the sake of illustration, but your IP will likely be different.
The most basic GET request that can be sent to the 460WI encodes all of the data points configured in
the Gateway. The only option in this case is deciding how you would like the data encoded.
If you would like the data encoded as XML, enter URL:
http://192.168.0.1/gateway/xml
If you would like the data encoded as JSON, enter URL:
http://192.168.0.1/gateway/json
NOTE:
Use http://IP_ADDRESS_OF_YOUR_UNIT/gateway/xml or
http://IP_ADDRESS_OF_YOUR_UNIT/gateway/json
All data requests will begin with one of the above URL paths. Further narrowing down your data
requests involves adding additional information to the URL’s path.
Note:
A common mistake is to include an extra forward slash with the request for all the data in the
Gateway (eg.
http://192.168.0.1/gateway/xml/
http://192.168.0.1/gateway/xml
).
The incorrect format will result in a “404 Not Found” error.
No data requests to the gateway will ever end with a forward slash.