38 / 48
The reproduction, distribution and utilization of this document as well as the communication of its contents to others without
express authorization is prohibited. Offenders will be held liable for the payment of damages.
All rights reserved in the event of the grant of patent, utility model or design.
14.04.2020
Version 1.18.0
Examples
REST
Use telnet or ssh to navigate inside the sensor and execute the script.
To see how the REST API works, do the following for help:
Example
~ # cd /opt/RestApi/test/
/opt/RestApi/test # ./testClient.py -h
usage: testClient.py [-h] [-i IP] [-p PORT] [-U USER] [-P PASSWORD] [-r ROUTE]
[-X CMD] [-v]
script for testing REST API routes
optional arguments:
-h, --help show this help message and exit
-i IP ip address
-p PORT port
-U USER username
-P PASSWORD password
-r ROUTE REST route
-X CMD HTTP command (verb) default=GET
-v, --verbose increase output verbosity
/opt/RestApi/test #
or to get all data at once:
./testClient.py
or to get only the counting line data:
./testClient.py -r /apiv1/sensorData/counts
You could copy the testClient.py python script to your server and modify it to your needs. For this example it require python
and curl to communicate with the device.
6.2
Tool Insomnia
Insomnia is a free cross-platform desktop application that takes the pain out of interacting with HTTP-based APIs.
Download Insomnia from