Skip to content

Latest commit

 

History

History
45 lines (41 loc) · 1.99 KB

http-api.md

File metadata and controls

45 lines (41 loc) · 1.99 KB
layout assignees title description redirect_from server-side-rpc client-side-rpc
docwithnav
ashvayka
HTTP Device API Reference
Supported HTTP API Reference for IoT Devices
/docs/reference/http-api
0 1 2 3 4
image title
/images/reference/device-connectivity-apis/server-side-rpc-http-1-ce.png
Use RPC debug terminal widget in your ThingsBoard instance
image title
/images/reference/device-connectivity-apis/server-side-rpc-http-2-ce.png
Subscribe to RPC commands from the server. To do this, in the first terminal window send GET request with observe flag
image title
/images/reference/device-connectivity-apis/server-side-rpc-http-3-ce.png
Send an RPC request "connect" to the device using RPC debug terminal widget
image title
/images/reference/device-connectivity-apis/server-side-rpc-http-4-ce.png
In the second terminal window simulate send a response from the device to the server
image title
/images/reference/device-connectivity-apis/server-side-rpc-http-5-ce.png
You should receive a response from the device: {"result":"ok"}
0 1 2 3 4
image title
/images/reference/device-connectivity-apis/client-side-rpc-1-ce.png
Add two nodes to the Rule Chain: "script" and "rpc call reply"
image title
/images/reference/device-connectivity-apis/client-side-rpc-2-ce.png
In the script node enter the function: return {msg: {time:String(new Date())}, metadata: metadata, msgType: msgType};
image
/images/reference/device-connectivity-apis/client-side-rpc-3-ce.png
image title
/images/reference/device-connectivity-apis/client-side-rpc-http-4-ce.png
Send request to the server
image title
/images/reference/device-connectivity-apis/client-side-rpc-http-5-ce.png
You should receive a response from the server

{% include get-hosts-name.html %} {% include docs/reference/http-api.md %}