diff --git a/_data/host-constant.yml b/_data/host-constant.yml index ef0915c235..54cc307b31 100644 --- a/_data/host-constant.yml +++ b/_data/host-constant.yml @@ -10,7 +10,7 @@ hostLabel: localhost hostName: localhost mqttHostName: localhost - coapHostName: coap.thingsboard.cloud + coapHostName: localhost httpsUrl: https://thingsboard.cloud lwm2mHostName: lwm2m.thingsboard.cloud apiHostName: YOUR_SERVER_HOSTNAME diff --git a/_includes/docs/reference/coap-api.md b/_includes/docs/reference/coap-api.md index 1c05be323a..d39035b8ed 100644 --- a/_includes/docs/reference/coap-api.md +++ b/_includes/docs/reference/coap-api.md @@ -1,55 +1,81 @@ +{% if docsPrefix == nil or docsPrefix == "pe/" %} +{% assign HOST_NAME = "$THINGSBOARD_HOST_NAME" %} +{% endif %} +{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} +{% assign HOST_NAME = "$THINGSBOARD_EDGE_HOST_NAME" %} +{% endif %} + * TOC {:toc} -## Getting started - -### CoAP basics +[CoAP](https://en.wikipedia.org/wiki/Constrained_Application_Protocol){:target="_blank"} is a lightweight, UDP-based protocol designed for constrained IoT devices. +Although it follows a request–response model similar to HTTP, CoAP is optimized for low-power and low-bandwidth networks. +You can find more information about CoAP [here](https://tools.ietf.org/html/rfc7252){:target="_blank"}. -[CoAP](https://en.wikipedia.org/wiki/Constrained_Application_Protocol) is a light-weight IoT protocol for constrained devices. You can find more information about CoAP [here](https://tools.ietf.org/html/rfc7252). -CoAP protocol is UDP based, but similar to HTTP it uses request-response model. -CoAP Observe [Option](https://tools.ietf.org/html/rfc7641) allows subscription to resources and receiving notifications on resource change. +CoAP Observe [Option](https://tools.ietf.org/html/rfc7641){:target="_blank"} allows subscription to resources and receiving notifications on resource change. ThingsBoard server nodes act as a CoAP Server that supports both regular and observe requests. -### Client libraries setup +
$THINGSBOARD_HOST_NAME with your host and $ACCESS_TOKEN with your device's access token. In this example, the hostname references your local installation.
-{% endif %}
-{% if docsPrefix contains "paas/" %}
-Don't forget to replace $ACCESS_TOKEN with your device's access token.
-{% endif %}
-{% if docsPrefix == "edge/" %}
-Don't forget to replace $THINGSBOARD_EDGE_HOST_NAME with your host and $ACCESS_TOKEN with your device's access token. In this example, the hostname references your local installation.
-{% endif %}
+> ⚠️ Don't forget to replace {% unless docsPrefix contains "paas/" %}
+ • {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN with your device's access token.
-**Example 1**. Publish data as an object without timestamp (server-side timestamp will be used) using data from [**telemetry-data-as-object.json**](/docs/reference/resources/telemetry-data-as-object.json) file.
+**Example 1**.
+Publish data as an object without timestamp (server-side timestamp will be used) using data from [telemetry-data-as-object.json](/docs/reference/resources/telemetry-data-as-object.json){:target="_blank" download="telemetry-data-as-object.json"} file.
{% capture tabspec %}coap-telemetry-upload
A,Execute the command:,shell,resources/coap-telemetry.sh,/docs/reference/resources/coap-telemetry.sh{% endcapture %}
@@ -124,7 +145,8 @@ The content of the JSON file:
```
{: .copy-code}
-**Example 2**. Publish data as an array of objects without timestamp (server-side timestamp will be used) using data from [**telemetry-data-as-array.json**](/docs/reference/resources/telemetry-data-as-array.json) file.
+**Example 2**.
+Publish data as an array of objects without timestamp (server-side timestamp will be used) using data from [telemetry-data-as-array.json](/docs/reference/resources/telemetry-data-as-array.json){:target="_blank" download="telemetry-data-as-array.json"} file.
{% capture tabspec %}coap-telemetry-upload-data-as-array
A,Execute the command:,shell,resources/coap-telemetry-data-as-array.sh,/docs/reference/resources/coap-telemetry-data-as-array.sh{% endcapture %}
@@ -137,7 +159,8 @@ The content of the JSON file:
```
{: .copy-code}
-**Example 3**. Publish data as an object with timestamp (telemetry timestamp will be used) using data from [**telemetry-data-with-ts.json**](/docs/reference/resources/telemetry-data-with-ts.json) file.
+**Example 3**.
+Publish data as an object with timestamp (telemetry timestamp will be used) using data from [telemetry-data-with-ts.json](/docs/reference/resources/telemetry-data-with-ts.json){:target="_blank" download="telemetry-data-with-ts.json"} file.
{% capture tabspec %}coap-telemetry-upload-data-with-ts
A,Execute the command:,shell,resources/coap-telemetry-data-with-ts.sh,/docs/reference/resources/coap-telemetry-data-with-ts.sh{% endcapture %}
@@ -165,13 +188,17 @@ The content of the JSON file:
```
{: .copy-code}
+{{HOST_NAME}} is your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN is the device's access token.
+
The simplest supported data formats are:
```json
@@ -76,43 +94,35 @@ In case your device is able to get the client-side timestamp, you can use follow
{"ts":1451649600512, "values":{"key1":"value1", "key2":"value2"}}
```
-Where **1451649600512** is a [unix timestamp](https://en.wikipedia.org/wiki/Unix_time) with milliseconds precision.
+Where **1451649600512** is a [unix timestamp](https://en.wikipedia.org/wiki/Unix_time){:target="_blank"} with milliseconds precision.
For example, the value '1451649600512' corresponds to 'Fri, 01 Jan 2016 12:00:00.512 GMT'
$THINGSBOARD_HOST_NAME with your host and $ACCESS_TOKEN with your device's access token. In this example, the hostname references your local installation.
-{% endif %}
-{% if docsPrefix contains "paas/" %}
-Don't forget to replace $ACCESS_TOKEN with your device's access token.
-{% endif %}
-{% if docsPrefix == "edge/" %}
-Don't forget to replace $THINGSBOARD_EDGE_HOST_NAME with your host and $ACCESS_TOKEN with your device's access token. In this example, the hostname references your local installation.
-{% endif %}
+> ⚠️ Don't forget to replace {% unless docsPrefix contains "paas/" %}
+ • {{HOST_NAME}} is your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN is your device's access token.
-**Example 1**. Publish data as an object without timestamp (server-side timestamp will be used).
+**Example 1**.
+Publish data as an object without timestamp (server-side timestamp will be used).
Execute the command:
-{% if docsPrefix == null or docsPrefix == "pe/" %}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-curl -v -X POST --data "{"temperature":42,"humidity":73}" http://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
+curl -v -X POST --data "{"temperature":42,"humidity":73}" http://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
```
{: .copy-code}
+
{% endif %}
{% if docsPrefix contains "paas/" %}
+
```shell
curl -v -X POST --data "{"temperature":42,"humidity":73}" {{httpsUrl}}/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
```
{: .copy-code}
-{% endif %}
-{% if docsPrefix == "edge/" %}
-```shell
-curl -v -X POST --data "{"temperature":42,"humidity":73}" http://$THINGSBOARD_EDGE_HOST_NAME/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
-```
-{: .copy-code}
+
{% endif %}
Telemetry data:
@@ -121,28 +131,28 @@ Telemetry data:
{"temperature":42,"humidity":73}
```
-**Example 2**. Publish data as an object without timestamp (server-side timestamp will be used) using data from [**telemetry-data-as-object.json**](/docs/reference/resources/telemetry-data-as-object.json) file.
+**Example 2**.
+Publish data as an object without timestamp (server-side timestamp will be used) using data from [telemetry-data-as-object.json](/docs/reference/resources/telemetry-data-as-object.json){:target="_blank" download="telemetry-data-as-object.json"} file.
Execute the command:
-{% if docsPrefix == null or docsPrefix == "pe/" %}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
+
```shell
-curl -v -X POST -d @telemetry-data-as-object.json http://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
+curl -v -X POST -d @telemetry-data-as-object.json http://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
```
{: .copy-code}
+
{% endif %}
{% if docsPrefix contains "paas/" %}
+
```shell
curl -v -X POST -d @telemetry-data-as-object.json {{httpsUrl}}/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
```
{: .copy-code}
+
{% endif %}
-{% if docsPrefix == "edge/" %}
-```shell
-curl -v -X POST -d @telemetry-data-as-object.json http://$THINGSBOARD_EDGE_HOST_NAME/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
-```
-{: .copy-code}
-{% endif %}
+
The content of the JSON file:
@@ -160,27 +170,25 @@ The content of the JSON file:
}
```
-**Example 3**. Publish data as an array of objects without timestamp (server-side timestamp will be used) using data from [**telemetry-data-as-array.json**](/docs/reference/resources/telemetry-data-as-array.json) file.
+**Example 3**.
+Publish data as an array of objects without timestamp (server-side timestamp will be used) using data from [telemetry-data-as-array.json](/docs/reference/resources/telemetry-data-as-array.json){:target="_blank" download="telemetry-data-as-array.json"} file.
Execute the command:
-{% if docsPrefix == null or docsPrefix == "pe/" %}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-curl -v -X POST -d @telemetry-data-as-array.json http://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
+curl -v -X POST -d @telemetry-data-as-array.json http://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
```
{: .copy-code}
+
{% endif %}
{% if docsPrefix contains "paas/" %}
+
```shell
curl -v -X POST -d @telemetry-data-as-array.json {{httpsUrl}}/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
```
{: .copy-code}
-{% endif %}
-{% if docsPrefix == "edge/" %}
-```shell
-curl -v -X POST -d @telemetry-data-as-array.json http://$THINGSBOARD_EDGE_HOST_NAME/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
-```
-{: .copy-code}
+
{% endif %}
The content of the JSON file:
@@ -189,27 +197,24 @@ The content of the JSON file:
[{"key1":"value1"}, {"key2":true}]
```
-**Example 4**. Publish data as an object with timestamp (telemetry timestamp will be used) using data from [**telemetry-data-with-ts.json**](/docs/reference/resources/telemetry-data-with-ts.json) file.
+**Example 4**. Publish data as an object with timestamp (telemetry timestamp will be used) using data from [telemetry-data-with-ts.json](/docs/reference/resources/telemetry-data-with-ts.json){:target="_blank" download="telemetry-data-with-ts.json"} file.
Execute the command:
-{% if docsPrefix == null or docsPrefix == "pe/" %}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-curl -v -X POST -d @telemetry-data-with-ts.json http://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
+curl -v -X POST -d @telemetry-data-with-ts.json http://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
```
{: .copy-code}
+
{% endif %}
{% if docsPrefix contains "paas/" %}
+
```shell
curl -v -X POST -d @telemetry-data-with-ts.json {{httpsUrl}}/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
```
{: .copy-code}
-{% endif %}
-{% if docsPrefix == "edge/" %}
-```shell
-curl -v -X POST -d @telemetry-data-with-ts.json http://$THINGSBOARD_EDGE_HOST_NAME/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
-```
-{: .copy-code}
+
{% endif %}
The content of the JSON file:
@@ -233,27 +238,28 @@ The content of the JSON file:
}
```
+{{HOST_NAME}} is your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN is the device's access token.
+$THINGSBOARD_HOST_NAME with your host and port and $ACCESS_TOKEN with your device's access token.
-{% endif %}
-{% if docsPrefix contains "paas/" %}
-Don't forget to replace $ACCESS_TOKEN with your device's access token.
-{% endif %}
-{% if docsPrefix == "edge/" %}
-Don't forget to replace $THINGSBOARD_EDGE_HOST_NAME with your host and port and $ACCESS_TOKEN with your device's access token.
-{% endif %}
+Below are the examples of commands for publishing different types of telemetry data.
-**Example 1**. Publish client-side attributes update
+**Example 1**.
+Publish client-side attributes update
-{% if docsPrefix == null or docsPrefix == "pe/" %}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-curl -v -X POST --data "{"attribute1": "value1", "attribute2":true, "attribute3": 43.0}" http://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/attributes --header "Content-Type:application/json"
+curl -v -X POST --data "{"attribute1": "value1", "attribute2":true, "attribute3": 43.0}" http://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/attributes --header "Content-Type:application/json"
```
{: .copy-code}
{% endif %}
@@ -292,33 +292,25 @@ curl -v -X POST --data "{"attribute1": "value1", "attribute2":true, "attribute3"
```
{: .copy-code}
{% endif %}
-{% if docsPrefix == "edge/" %}
-```shell
-curl -v -X POST --data "{"attribute1": "value1", "attribute2":true, "attribute3": 43.0}" http://$THINGSBOARD_EDGE_HOST_NAME/api/v1/$ACCESS_TOKEN/attributes --header "Content-Type:application/json"
-```
-{: .copy-code}
-{% endif %}
+**Example 2**.
+Publish client-side attributes update from the [new-attributes-values.json](/docs/reference/resources/new-attributes-values.json){:target="_blank" download="new-attributes-values.json"} file.
-**Example 2**. Publish client-side attributes update from the [**new-attributes-values.json**](/docs/reference/resources/new-attributes-values.json) file.
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
-{% if docsPrefix == null or docsPrefix == "pe/" %}
```shell
-curl -v -X POST -d @new-attributes-values.json http://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/attributes --header "Content-Type:application/json"
+curl -v -X POST -d @new-attributes-values.json http://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/attributes --header "Content-Type:application/json"
```
{: .copy-code}
+
{% endif %}
{% if docsPrefix contains "paas/" %}
+
```shell
curl -v -X POST -d @new-attributes-values.json {{httpsUrl}}/api/v1/$ACCESS_TOKEN/attributes --header "Content-Type:application/json"
```
{: .copy-code}
-{% endif %}
-{% if docsPrefix == "edge/" %}
-```shell
-curl -v -X POST -d @new-attributes-values.json http://$THINGSBOARD_EDGE_HOST_NAME/api/v1/$ACCESS_TOKEN/attributes --header "Content-Type:application/json"
-```
-{: .copy-code}
+
{% endif %}
The content of the JSON file:
@@ -338,19 +330,18 @@ The content of the JSON file:
```
{: .copy-code}
+$THINGSBOARD_HOST_NAME with your host and port and $ACCESS_TOKEN with your device's access token.
-{% endif %}
-{% if docsPrefix contains "paas/" %}
-Execute the command. Don't forget to replace $ACCESS_TOKEN with your device's access token.
-{% endif %}
-{% if docsPrefix == "edge/" %}
-Execute the command. Don't forget to replace $THINGSBOARD_EDGE_HOST_NAME with your host and port and $ACCESS_TOKEN with your device's access token.
-{% endif %}
+> Where {% unless docsPrefix contains "paas/" %}
+ • {{HOST_NAME}} is your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN is the device's access token.
-{% if docsPrefix == "pe/" %}
+{{HOST_NAME}} is your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN is the device's access token.
-{% if docsPrefix == null or docsPrefix == "pe/" %}
-Execute the command. Don't forget to replace $THINGSBOARD_HOST_NAME with your host and port and $ACCESS_TOKEN with your device's access token.
-{% endif %}
-{% if docsPrefix contains "paas/" %}
-Execute the command. Don't forget to replace $ACCESS_TOKEN with your device's access token.
-{% endif %}
-{% if docsPrefix == "edge/" %}
-Execute the command. Don't forget to replace $THINGSBOARD_EDGE_HOST_NAME with your host and port and $ACCESS_TOKEN with your device's access token.
-{% endif %}
+Once shared attribute will be changed by one of the server-side components (REST API or Rule Chain) the client will receive the following update:
-{% if docsPrefix == "pe/" %}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-curl -v -X GET http://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/attributes/updates?timeout=20000
+curl -v -X GET http://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/attributes/updates?timeout=20000
```
{: .copy-code}
+
{% endif %}
{% if docsPrefix contains "paas/" %}
+
```shell
curl -v -X GET {{httpsUrl}}/api/v1/$ACCESS_TOKEN/attributes/updates?timeout=20000
```
{: .copy-code}
-{% endif %}
-{% if docsPrefix == "edge/" %}
-```shell
-curl -v -X GET http://$THINGSBOARD_EDGE_HOST_NAME/api/v1/$ACCESS_TOKEN/attributes/updates?timeout=20000
-```
-{: .copy-code}
+
{% endif %}
Result:
@@ -465,25 +437,26 @@ Result:
{"client":{"attribute1":"value1","attribute2":true}}
```
+{{HOST_NAME}} is your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN is the device's access token.
+
Once subscribed, a client may receive rpc request or a timeout message if there are no requests to a particular device.
An example of RPC request body is shown below:
@@ -510,17 +485,16 @@ An example of RPC request body is shown below:
}
```
-where
-
- - **id** - request id, integer request identifier
- - **method** - RPC method name, string
- - **params** - RPC method params, custom json object
+> Where
+ • **id** - request id, integer request identifier
+ • **method** - RPC method name, string
+ • **params** - RPC method params, custom json object
It is possible to reply to them using POST request to the following URL:
-{% if docsPrefix == null or docsPrefix == "pe/" %}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-http(s)://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc/{$id}
+http(s)://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/rpc/{$id}
```
{: .copy-code}
@@ -534,48 +508,42 @@ http(s)://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc/{$id}
{% endif %}
-Where
-- **$id** is an integer request identifier.
+> Where $id is an integer request identifier.
$THINGSBOARD_HOST_NAME with your host and $ACCESS_TOKEN with your device's access token:
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-curl -v -X GET http://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc?timeout=20000
+curl -v -X GET http://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/rpc?timeout=20000
```
{: .copy-code}
+
{% endif %}
{% if docsPrefix contains "paas/" %}
-- Subscribe to RPC commands from the server using the command below. Don't forget to replace $ACCESS_TOKEN with your device's access token:
```shell
curl -v -X GET {{httpsUrl}}/api/v1/$ACCESS_TOKEN/rpc?timeout=20000
```
{: .copy-code}
-{% endif %}
-{% if docsPrefix == "edge/" %}
-- Subscribe to RPC commands from the server using the command below. Don't forget to replace $THINGSBOARD_EDGE_HOST_NAME with your host and $ACCESS_TOKEN with your device's access token:
-```shell
-curl -v -X GET http://$THINGSBOARD_EDGE_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc?timeout=20000
-```
-{: .copy-code}
{% endif %}
-- Send an RPC request "connect" to the device using **RPC debug terminal** widget;
-
-- Save the "[rpc-response.json](/docs/reference/resources/rpc-response.json)" file to your PC;
+> Where {% unless docsPrefix contains "paas/" %}
+ • {{HOST_NAME}} is your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN is the device's access token.
+- Send an RPC request "connect" to the device using **RPC debug terminal** widget;
+- Save the [rpc-response.json](/docs/reference/resources/rpc-response.json){:target="_blank" download="rpc-response.json"} file to your PC;
- In the second terminal window simulate sending a response from the device to the server:
-{% if docsPrefix == null or docsPrefix == "pe/" %}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-curl -v -X POST -d @rpc-response.json http://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc/1 --header "Content-Type:application/json"
+curl -v -X POST -d @rpc-response.json http://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/rpc/1 --header "Content-Type:application/json"
```
{: .copy-code}
{% endif %}
@@ -585,34 +553,29 @@ curl -v -X POST -d @rpc-response.json {{httpsUrl}}/api/v1/$ACCESS_TOKEN/rpc/1 --
```
{: .copy-code}
{% endif %}
-{% if docsPrefix == "edge/" %}
-```shell
-curl -v -X POST -d @rpc-response.json http://$THINGSBOARD_EDGE_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc/1 --header "Content-Type:application/json"
-```
-{: .copy-code}
-{% endif %}
-- You should receive a response from the device:
+You should receive a response from the device:
```shell
{"result":"ok"}
```
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "paas/" or docsPrefix == "paas/eu/" %}
{% include images-gallery.html imageCollection="server-side-rpc" %}
+{% endif %}
+
+{{HOST_NAME}} is your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN is the device's access token.
+
Both request and response body should be valid JSON documents. The content of the documents is specific to the rule node that will handle your request.
$THINGSBOARD_HOST_NAME with your host and $ACCESS_TOKEN with your device's access token:
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-curl -X POST -d @rpc-client-request.json http://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc --header "Content-Type:application/json"
+curl -X POST -d @rpc-client-request.json http://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/rpc --header "Content-Type:application/json"
```
{: .copy-code}
+
{% endif %}
{% if docsPrefix contains "paas/" %}
-- Now, send request to the server using the command below. Don't forget to replace $ACCESS_TOKEN with your device's access token:
```shell
curl -X POST -d @rpc-client-request.json {{httpsUrl}}/api/v1/$ACCESS_TOKEN/rpc --header "Content-Type:application/json"
```
{: .copy-code}
-{% endif %}
-{% if docsPrefix == "edge/" %}
-- Now, send request to the server using the command below. Don't forget to replace $THINGSBOARD_EDGE_HOST_NAME with your host and $ACCESS_TOKEN with your device's access token:
-```shell
-curl -X POST -d @rpc-client-request.json http://$THINGSBOARD_EDGE_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc --header "Content-Type:application/json"
-```
-{: .copy-code}
{% endif %}
-- You should receive a response from the server:
+You should receive a response from the server:
```shell
-{"time":"2016 11 21 12:54:44.287"}
+{"time":"Thursday, February 5, 2026, 9:08:22 AM Coordinated Universal Time"}
```
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "paas/" or docsPrefix == "paas/eu/" %}
{% include images-gallery.html imageCollection="client-side-rpc" %}
+{% endif %}
+
+{{HOST_NAME}} is your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN is the device's access token.
+
+**Request payload**
+The request body must contain the following JSON structure:
```json
{"secretKey":"value", "durationMs":60000}
```
+**Payload fields**
+- **secretKey** — a secret value used to authorize the claiming process
+- **durationMs** — the time window (in milliseconds) during which the device can be claimed
+
{% capture difference %}
-**Please note**
-{{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge" %} Edge{% endif %} hostname or IP address.
+> • {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
> • $ACCESS_TOKEN with your device's access token.
```bash
@@ -91,7 +90,7 @@ mosquitto_pub -d -q 1 -h "{{HOST_NAME}}" -p "1883" -t "v1/devices/me/telemetry"
{: .copy-code}
**Example**
-In this example, {{HOST_NAME}} refers to your local ThingsBoard {% if docsPrefix == "edge/" or docsPrefix == "pe/edge" %}Edge {% endif %}installation, and $ACCESS_TOKEN is set to ABC123.
+In this example, {{HOST_NAME}} refers to your local ThingsBoard {% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}Edge {% endif %}installation, and $ACCESS_TOKEN is set to ABC123.
```bash
mosquitto_pub -d -q 1 -h "localhost" -p "1883" -t "v1/devices/me/telemetry" -u "ABC123" -m {"temperature":25}
@@ -279,7 +278,7 @@ v1/devices/me/attributes
```
{: .copy-code}
-localhost with the appropriate hostname or IP address.
+{% unless docsPrefix contains 'paas/' %}
-{% endif %}
-{% if docsPrefix contains 'paas/' %}
-**1.** Save the [mqtt-js-attributes-request.js](/docs/paas/reference/resources/mqtt-js-attributes-request.js){:target="_blank" download="mqtt-js-attributes-request.js"} file to your PC.
-{% endif %}
-{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
-**1.** Save the [mqtt-js-attributes-request.js](/docs/edge/reference/resources/mqtt-js-attributes-request.js){:target="_blank" download="mqtt-js-attributes-request.js"} file to your PC.
-
-> ⚠️ In this example, the hostname refers to a **local ThingsBoard Edge installation**.
-> If your ThingsBoard Edge instance is deployed on a different host, make sure to replace localhost with the appropriate hostname or IP address.
+> ⚠️ In this example, the hostname refers to a **local ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} installation**.
+> If your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} instance is deployed on a different host, make sure to replace localhost with the appropriate hostname or IP address.
-{% endif %}
+{% endunless %}
{% capture tabspec %}mqtt-attributes-request
A,The content of the "mqtt-js-attributes-request.js" file:,javascript,resources/mqtt-js-attributes-request.js,/docs/reference/resources/mqtt-js-attributes-request.js{% endcapture %}
@@ -518,11 +508,12 @@ Your MQTT gateway device will receive a service RPC about removal or renaming of
In order to send RPC commands to server, send PUBLISH message to the following topic:
```shell
-v1/devices/me/rpc/request/$request_id
+v1/devices/me/rpc/request/$REQUEST_ID
```
{: .copy-code}
-where **$request_id** is an integer request identifier.
+> Where $REQUEST_ID is an integer request identifier.
+
The response from server will be published to the following topic:
```shell
@@ -556,11 +547,11 @@ A,The content of the "mqtt-js-rpc-from-client.js" file,javascript,resources/mqtt
{% include tabs.html %}
**2.** Now, follow these steps:
-- In the {% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}**Edge** {% endif %}**Root Rule Chain** add two nodes: [script](/docs/user-guide/rule-engine-2-0/nodes/transformation/script){:target="_blank"} and [rpc call reply](/docs/user-guide/rule-engine-2-0/nodes/action/rpc-call-reply){:target="_blank"}.
+- In the {% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}**Edge** {% endif %}**Root Rule Chain** add two nodes: [transformation script](/docs/user-guide/rule-engine-2-0/nodes/transformation/script){:target="_blank"} and [rpc call reply](/docs/user-guide/rule-engine-2-0/nodes/action/rpc-call-reply){:target="_blank"}. Connect them to "[Log RPC from Device](/docs/user-guide/rule-engine-2-0/nodes/action/log){:target="_blank"}" action node with "**Success**" link.
- In the **script** node enter the function:
```shell
-return {msg: {time:String(new Date())}, metadata: metadata, msgType: msgType};
+return {msg: {time: new Date()}, metadata: metadata, msgType: msgType};
```
{: .copy-code}
@@ -574,7 +565,11 @@ node mqtt-js-rpc-from-client.js
```
{: .copy-code}
-- You should receive a response from the server.
+You should receive a response from the server:
+
+```shell
+{"time":"Thursday, February 5, 2026, 9:08:22 AM Coordinated Universal Time"}
+```
{% unless docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
{% include images-gallery.html imageCollection="client-side-rpc" %}
@@ -666,7 +661,8 @@ These limits help control load and ensure stable operation when multiple devices
## Claiming devices
-Please see the corresponding article to get more information about the [Claiming devices](/docs/{{docsPrefix}}user-guide/claiming-devices){:target="_blank"} feature.
+The Device Claiming feature allows end users to securely associate a device with their account after the device has been deployed and connected to ThingsBoard.
+For a detailed explanation of the device claiming workflow and supported scenarios, refer to the {% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix contains "paas/" %}[Claiming devices](/docs/{{docsPrefix}}user-guide/claiming-devices){:target="_blank"}{% endif %}{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}[Claiming devices](/docs/user-guide/claiming-devices){:target="_blank"}{% endif %} documentation.
In order to initiate claiming device, send PUBLISH message to the following topic:
@@ -691,9 +687,11 @@ In case the **durationMs** is not specified, the system parameter **device.claim
## Device provisioning
-Please see the corresponding article to get more information about the [Device provisioning](/docs/{{docsPrefix}}user-guide/device-provisioning){:target="_blank"} feature.
+Device provisioning allows devices to be registered dynamically without manual creation in the ThingsBoard UI.
+For a detailed explanation of the provisioning process and supported scenarios, refer to the {% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix contains "paas/" %}[Device provisioning](/docs/{{docsPrefix}}user-guide/device-provisioning){:target="_blank"}{% endif %}{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}[Device provisioning](/docs/user-guide/device-provisioning){:target="_blank"}{% endif %} documentation.
-In order to initiate device provisioning, send Provisioning request to the following topic:
+**Provisioning request**
+To initiate device provisioning, send Provisioning request to the following topic:
```shell
/provision
@@ -702,7 +700,8 @@ In order to initiate device provisioning, send Provisioning request to the follo
Also, you should set **username** or **clientId** to *provision*.
-The supported data format is:
+**Request Payload**
+The provisioning request must use the following JSON format:
```json
{
@@ -712,6 +711,13 @@ The supported data format is:
}
```
+**Payload fields**
+- **deviceName** — the name of the device to be provisioned.
+- **provisionDeviceKey** — the provisioning key configured in ThingsBoard.
+- **provisionDeviceSecret** — the provisioning secret associated with the provisioning key.
+
+If the provided credentials are valid, ThingsBoard automatically creates the device (if it does not already exist) and returns the device credentials, allowing the device to start communicating with the platform.
+
{{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN with your device's access token.
\ No newline at end of file
diff --git a/_includes/templates/api/coap/claiming-devices-certificate.md b/_includes/templates/api/coap/claiming-devices-certificate.md
index 317aa2714f..afdf303d5f 100644
--- a/_includes/templates/api/coap/claiming-devices-certificate.md
+++ b/_includes/templates/api/coap/claiming-devices-certificate.md
@@ -1,15 +1,17 @@
Send POST request to the following URL:
-{% if docsPrefix == null or docsPrefix == "pe/"%}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
+
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/claim
+coap://{{HOST_NAME}}/api/v1/claim
```
{: .copy-code}
-Where **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address.
+> ⚠️ Don't forget to replace {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
{% endif %}
{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
+
```shell
coap://{{coapHostName}}/api/v1/claim
```
diff --git a/_includes/templates/api/coap/client-side-rpc-access-token.md b/_includes/templates/api/coap/client-side-rpc-access-token.md
index 8bb7e6e6f4..0931f8d500 100644
--- a/_includes/templates/api/coap/client-side-rpc-access-token.md
+++ b/_includes/templates/api/coap/client-side-rpc-access-token.md
@@ -1,71 +1,67 @@
Send POST request to the following URL:
-{% if docsPrefix == null or docsPrefix == "pe/"%}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc
+coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/rpc
```
{: .copy-code}
-Where
-- **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address;
-- **$ACCESS_TOKEN** is device access token.
-
{% endif %}
-{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
+{% if docsPrefix contains "paas/" %}
+
```shell
coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/rpc
```
{: .copy-code}
-Where **$ACCESS_TOKEN** is device access token.
-
{% endif %}
+> Where {% unless docsPrefix contains "paas/" %}
+ • {{HOST_NAME}} is your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN is your device's access token.
+
Both request and response body should be valid JSON documents. The content of the documents is specific to the rule node that will handle your request.
$THINGSBOARD_HOST_NAME with your host and $ACCESS_TOKEN with your device's access token:
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-cat rpc-client-request.json | coap post coap://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc
+cat rpc-client-request.json | coap post coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/rpc
```
{: .copy-code}
+
{% endif %}
-{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
-- Now, send request to the server using the command below. Don't forget to replace $ACCESS_TOKEN with your device's access token:
+{% if docsPrefix contains "paas/" %}
```shell
cat rpc-client-request.json | coap post coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/rpc
```
{: .copy-code}
{% endif %}
-{% if docsPrefix == "edge/" %}
-- Now, send request to the server using the command below. Don't forget to replace $THINGSBOARD_EDGE_HOST_NAME with your host and $ACCESS_TOKEN with your device's access token:
-```shell
-cat rpc-client-request.json | coap post coap://$THINGSBOARD_EDGE_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc
-```
-{: .copy-code}
-{% endif %}
+> ⚠️ Replace {% unless docsPrefix contains "paas/" %}
+ • {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN with your device's access token.
- You should receive a response from the server:
```shell
-{"time":"2016 11 21 12:54:44.287"}
+{"time":"Thursday, February 5, 2026, 9:08:22 AM Coordinated Universal Time"}
```
-{% include images-gallery.html imageCollection="client-side-rpc" %}
\ No newline at end of file
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "paas/" or docsPrefix == "paas/eu/" %}
+{% include images-gallery.html imageCollection="client-side-rpc" %}
+{% endif %}
\ No newline at end of file
diff --git a/_includes/templates/api/coap/client-side-rpc-certificate.md b/_includes/templates/api/coap/client-side-rpc-certificate.md
index 1a1a7c1c8d..97284bf46e 100644
--- a/_includes/templates/api/coap/client-side-rpc-certificate.md
+++ b/_includes/templates/api/coap/client-side-rpc-certificate.md
@@ -1,15 +1,17 @@
Send POST request to the following URL:
-{% if docsPrefix == null or docsPrefix == "pe/"%}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
+
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/rpc
+coap://{{HOST_NAME}}/api/v1/rpc
```
{: .copy-code}
-Where **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address.
+> ⚠️ Where {{HOST_NAME}} is your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
{% endif %}
-{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
+{% if docsPrefix contains "paas/" %}
+
```shell
coap://{{coapHostName}}/api/v1/rpc
```
@@ -20,10 +22,9 @@ coap://{{coapHostName}}/api/v1/rpc
Both request and response body should be valid JSON documents. The content of the documents is specific to the rule node that will handle your request.
$THINGSBOARD_HOST_NAME with your host:
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-cat rpc-client-request.json | coap post coap://$THINGSBOARD_HOST_NAME/api/v1/rpc
+cat rpc-client-request.json | coap post coap://{{HOST_NAME}}/api/v1/rpc
```
{: .copy-code}
+
+> ⚠️ Replace {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+
{% endif %}
-{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
-- Now, send request to the server using the command below:
+{% if docsPrefix contains "paas/" %}
```shell
cat rpc-client-request.json | coap post coap://{{coapHostName}}/api/v1/rpc
```
{: .copy-code}
-{% endif %}
-{% if docsPrefix == "edge/" %}
-- Now, send request to the server using the command below. Don't forget to replace $THINGSBOARD_EDGE_HOST_NAME with your host:
-```shell
-cat rpc-client-request.json | coap post coap://$THINGSBOARD_EDGE_HOST_NAME/api/v1/rpc
-```
-{: .copy-code}
{% endif %}
- You should receive a response from the server:
@@ -64,4 +60,6 @@ cat rpc-client-request.json | coap post coap://$THINGSBOARD_EDGE_HOST_NAME/api/v
{"time":"2016 11 21 12:54:44.287"}
```
-{% include images-gallery.html imageCollection="client-side-rpc-certificate" %}
\ No newline at end of file
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "paas/" or docsPrefix == "paas/eu/" %}
+{% include images-gallery.html imageCollection="client-side-rpc-certificate" %}
+{% endif %}
\ No newline at end of file
diff --git a/_includes/templates/api/coap/firmware-api-access-token.md b/_includes/templates/api/coap/firmware-api-access-token.md
index c01b474b9e..47904a6e45 100644
--- a/_includes/templates/api/coap/firmware-api-access-token.md
+++ b/_includes/templates/api/coap/firmware-api-access-token.md
@@ -1,16 +1,16 @@
The CoAP client has to issue the GET request to
-{% if docsPrefix == null or docsPrefix == "pe/"%}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap get coap://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/firmware?title=$TITLE&version=$VERSION
+coap get coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/firmware?title=$TITLE&version=$VERSION
```
{: .copy-code}
Where
-- **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address;
-- **$ACCESS_TOKEN** is device access token;
-- **$TITLE** is the firmware title;
-- **$VERSION** is the version of the target firmware.
+- **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address
+- **$ACCESS_TOKEN** is device access token
+- **$TITLE** is the firmware title
+- **$VERSION** is the version of the target firmware
{% endif %}
{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
@@ -20,8 +20,8 @@ coap get coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/firmware?title=$TITLE&vers
{: .copy-code}
Where
-- **$ACCESS_TOKEN** is device access token;
-- **$TITLE** is the firmware title;
-- **$VERSION** is the version of the target firmware.
+- **$ACCESS_TOKEN** is device access token
+- **$TITLE** is the firmware title
+- **$VERSION** is the version of the target firmware
{% endif %}
\ No newline at end of file
diff --git a/_includes/templates/api/coap/firmware-api-certificate.md b/_includes/templates/api/coap/firmware-api-certificate.md
index 38d4e9d559..463c032e0e 100644
--- a/_includes/templates/api/coap/firmware-api-certificate.md
+++ b/_includes/templates/api/coap/firmware-api-certificate.md
@@ -1,8 +1,8 @@
The CoAP client has to issue the GET request to
-{% if docsPrefix == null or docsPrefix == "pe/"%}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap get coap://$THINGSBOARD_HOST_NAME/api/v1/firmware?title=$TITLE&version=$VERSION
+coap get coap://{{HOST_NAME}}/api/v1/firmware?title=$TITLE&version=$VERSION
```
{: .copy-code}
diff --git a/_includes/templates/api/coap/publish-attribute-update-access-token.md b/_includes/templates/api/coap/publish-attribute-update-access-token.md
index 352d72e567..728f95d8f3 100644
--- a/_includes/templates/api/coap/publish-attribute-update-access-token.md
+++ b/_includes/templates/api/coap/publish-attribute-update-access-token.md
@@ -1,23 +1,55 @@
Send POST request to the following URL:
-{% if docsPrefix == null or docsPrefix == "pe/" %}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/attributes
+coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/attributes
```
{: .copy-code}
-Where
-- **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address;
-- **$ACCESS_TOKEN** is device access token.
+{% else %}
+
+```shell
+coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/attributes
+```
+{: .copy-code}
{% endif %}
-{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
+> ⚠️ Don't forget to replace {% unless docsPrefix contains "paas/" %}
+ • {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN with your device's access token.
+
+Publish client-side attributes update using data from [new-attributes-values.json](/docs/reference/resources/new-attributes-values.json){:target="_blank" download="new-attributes-values.json"} file.
+
+The content of the **"new-attributes-values.json"** file:
+
+```json
+{
+ "attribute1": "value1",
+ "attribute2": true,
+ "attribute3": 42.0,
+ "attribute4": 73,
+ "attribute5": {
+ "someNumber": 42,
+ "someArray": [1,2,3],
+ "someNestedObject": {"key": "value"}
+ }
+}
+```
+
+**Execute the command:**
+
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/attributes
+cat new-attributes-values.json | coap post coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/attributes
```
{: .copy-code}
-Where **$ACCESS_TOKEN** is device access token.
+{% else %}
+
+```shell
+cat new-attributes-values.json | coap post coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/attributes
+```
+{: .copy-code}
{% endif %}
\ No newline at end of file
diff --git a/_includes/templates/api/coap/publish-attribute-update-certificate.md b/_includes/templates/api/coap/publish-attribute-update-certificate.md
index e80bd657fc..8d54607560 100644
--- a/_includes/templates/api/coap/publish-attribute-update-certificate.md
+++ b/_includes/templates/api/coap/publish-attribute-update-certificate.md
@@ -1,19 +1,53 @@
Send POST request to the following URL:
-{% if docsPrefix == null or docsPrefix == "pe/" %}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/attributes
+coap://{{HOST_NAME}}/api/v1/attributes
```
{: .copy-code}
-Where **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address.
+> ⚠️ Don't forget to replace {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
-{% endif %}
-{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
+{% else %}
```shell
coap://{{coapHostName}}/api/v1/attributes
```
{: .copy-code}
+{% endif %}
+
+Publish client-side attributes update using data from [new-attributes-values.json](/docs/reference/resources/new-attributes-values.json){:target="_blank" download="new-attributes-values.json"} file.
+
+The content of the **"new-attributes-values.json"** file:
+
+```json
+{
+ "attribute1": "value1",
+ "attribute2": true,
+ "attribute3": 42.0,
+ "attribute4": 73,
+ "attribute5": {
+ "someNumber": 42,
+ "someArray": [1,2,3],
+ "someNestedObject": {"key": "value"}
+ }
+}
+```
+
+**Execute the command:**
+
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
+```shell
+cat new-attributes-values.json | coap post coap://{{HOST_NAME}}/api/v1/attributes
+```
+{: .copy-code}
+
+{% else %}
+
+```shell
+cat new-attributes-values.json | coap post coap://{{coapHostName}}/api/v1/attributes
+```
+{: .copy-code}
+
{% endif %}
\ No newline at end of file
diff --git a/_includes/templates/api/coap/request-attribute-values-access-token.md b/_includes/templates/api/coap/request-attribute-values-access-token.md
index c86849eb66..df00451280 100644
--- a/_includes/templates/api/coap/request-attribute-values-access-token.md
+++ b/_includes/templates/api/coap/request-attribute-values-access-token.md
@@ -1,22 +1,42 @@
Send GET request to the following URL:
-{% if docsPrefix == null or docsPrefix == "pe/"%}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/attributes?clientKeys=attribute1,attribute2&sharedKeys=shared1,shared2
+coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/attributes?clientKeys=attribute1,attribute2&sharedKeys=shared1,shared2
```
{: .copy-code}
-Where
-- **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address;
-- **$ACCESS_TOKEN** is device access token.
+{% else %}
-{% endif %}
-{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
```shell
coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/attributes?clientKeys=attribute1,attribute2&sharedKeys=shared1,shared2
```
{: .copy-code}
-Where **$ACCESS_TOKEN** is device access token.
+{% endif %}
+
+> ⚠️ Don't forget to replace {% unless docsPrefix contains "paas/" %}
+ • {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN with your device's access token.
+
+{% capture difference %}
+**Note**: This example shown with the coap-client instead of CoAP cli since CoAP cli does not support query parameters. Please refer to [Client libraries setup](#docsContent).
+{% endcapture %}
+{% include templates/info-banner.md content=difference %}
+
+**Execute the command:**
+
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
+```shell
+coap-client -m get "coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/attributes?clientKeys=attribute1,attribute2&sharedKeys=shared1,shared2"
+```
+{: .copy-code}
+
+{% else %}
+
+```shell
+coap-client -m get "coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/attributes?clientKeys=attribute1,attribute2&sharedKeys=shared1,shared2"
+```
+{: .copy-code}
{% endif %}
\ No newline at end of file
diff --git a/_includes/templates/api/coap/request-attribute-values-certificate.md b/_includes/templates/api/coap/request-attribute-values-certificate.md
index cbd18e6fc5..e7eebac43e 100644
--- a/_includes/templates/api/coap/request-attribute-values-certificate.md
+++ b/_includes/templates/api/coap/request-attribute-values-certificate.md
@@ -1,18 +1,40 @@
Send GET request to the following URL:
-{% if docsPrefix == null or docsPrefix == "pe/"%}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/attributes?clientKeys=attribute1,attribute2&sharedKeys=shared1,shared2
+coap://{{HOST_NAME}}/api/v1/attributes?clientKeys=attribute1,attribute2&sharedKeys=shared1,shared2
```
{: .copy-code}
-Where **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address.
+> ⚠️ Don't forget to replace {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+
+{% else %}
-{% endif %}
-{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
```shell
coap://{{coapHostName}}/api/v1/attributes?clientKeys=attribute1,attribute2&sharedKeys=shared1,shared2
```
{: .copy-code}
+{% endif %}
+
+{% capture difference %}
+**Note**: This example shown with the coap-client instead of CoAP cli since CoAP cli does not support query parameters. Please refer to [Client libraries setup](#docsContent).
+{% endcapture %}
+{% include templates/info-banner.md content=difference %}
+
+**Execute the command:**
+
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
+```shell
+coap-client -m get "coap://{{HOST_NAME}}/api/v1/attributes?clientKeys=attribute1,attribute2&sharedKeys=shared1,shared2"
+```
+{: .copy-code}
+
+{% else %}
+
+```shell
+coap-client -m get "coap://{{coapHostName}}/api/v1/attributes?clientKeys=attribute1,attribute2&sharedKeys=shared1,shared2"
+```
+{: .copy-code}
+
{% endif %}
\ No newline at end of file
diff --git a/_includes/templates/api/coap/server-side-rpc-access-token.md b/_includes/templates/api/coap/server-side-rpc-access-token.md
index 78762966a7..3f2a58f0df 100644
--- a/_includes/templates/api/coap/server-side-rpc-access-token.md
+++ b/_includes/templates/api/coap/server-side-rpc-access-token.md
@@ -1,26 +1,25 @@
Send GET request with observe flag to the following URL:
-{% if docsPrefix == null or docsPrefix == "pe/"%}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc
+coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/rpc
```
{: .copy-code}
-Where
-- **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address;
-- **$ACCESS_TOKEN** is device access token.
-
{% endif %}
{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
+
```shell
coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/rpc
```
{: .copy-code}
-Where **$ACCESS_TOKEN** is device access token.
-
{% endif %}
+> Where {% unless docsPrefix contains "paas/" %}
+ • {{HOST_NAME}} is your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN is your device's access token.
+
Once subscribed, a client may receive RPC requests. An example of RPC request body is shown below:
```json
@@ -34,21 +33,22 @@ Once subscribed, a client may receive RPC requests. An example of RPC request bo
}
```
-Where
-
-- **id** - request id, integer request identifier;
-- **method** - RPC method name, string;
-- **params** - RPC method params, custom json object.
+> Where
+ • **id** - request id, integer request identifier
+ • **method** - RPC method name, string
+ • **params** - RPC method params, custom json object
-and can reply to them using POST request to the following URL:
+To reply to an RPC request, send a POST request to the following URL
-{% if docsPrefix == null or docsPrefix == "pe/"%}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc/{$id}
+coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/rpc/{$id}
```
{: .copy-code}
+
{% endif %}
{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
+
```shell
coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/rpc/{$id}
```
@@ -56,38 +56,31 @@ coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/rpc/{$id}
{% endif %}
-Where **$id** is an integer request identifier.
+> Where $id is an integer request identifier.
-$THINGSBOARD_HOST_NAME with your host and $ACCESS_TOKEN with your device's access token:
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap-client -m get coap://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc -s 100 -B 100
+coap-client -m get coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/rpc -s 100 -B 100
```
{: .copy-code}
+
{% endif %}
-{% if docsPrefix contains "paas/" %}
-- Subscribe to RPC commands from the server using the command below. Don't forget to replace $ACCESS_TOKEN with your device's access token:
+{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
```shell
coap-client -m get coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/rpc -s 100 -B 100
```
{: .copy-code}
-{% endif %}
-{% if docsPrefix == "edge/" %}
-- Subscribe to RPC commands from the server using the command below. Don't forget to replace $THINGSBOARD_EDGE_HOST_NAME with your host and $ACCESS_TOKEN with your device's access token:
-```shell
-coap-client -m get coap://$THINGSBOARD_EDGE_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc -s 100 -B 100
-```
-{: .copy-code}
{% endif %}
+
{% capture difference %}
The "`s`" option stands for subscribe and the value has to be specified in seconds.
@@ -95,35 +88,36 @@ The "`B`" options stands for break (the operation will be break after desired ti
{% endcapture %}
{% include templates/info-banner.md content=difference %}
-- Send an RPC request "connect" to the device using **RPC debug terminal** widget;
-
-- Save the "[rpc-response.json](/docs/reference/resources/rpc-response.json)" file to your PC;
-
+- Send an RPC request "connect" to the device using **RPC debug terminal** widget.
+- Save the [rpc-response.json](/docs/reference/resources/rpc-response.json){:target="_blank" download="rpc-response.json"} file to your PC.
- In the second terminal window simulate sending a response from the device to the server:
-{% if docsPrefix == null or docsPrefix == "pe/" %}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap-client -f rpc-response.json -m post coap://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc/1
+coap-client -f rpc-response.json -m post coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/rpc/1
```
{: .copy-code}
+
{% endif %}
-{% if docsPrefix contains "paas/" %}
+{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/" %}
+
```shell
cat rpc-response.json | coap post coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/rpc/1
```
{: .copy-code}
+
{% endif %}
-{% if docsPrefix == "edge/" %}
-```shell
-coap-client -f rpc-response.json -m post coap://$THINGSBOARD_EDGE_HOST_NAME/api/v1/$ACCESS_TOKEN/rpc/1
-```
-{: .copy-code}
-{% endif %}
-- You should receive a response from the device:
+> ⚠️ Replace {% unless docsPrefix contains "paas/" %}
+ • {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN with your device's access token.
+
+You should receive a response from the device:
```shell
{"result":"ok"}
```
-{% include images-gallery.html imageCollection="server-side-rpc" %}
\ No newline at end of file
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "paas/" or docsPrefix == "paas/eu/" %}
+{% include images-gallery.html imageCollection="server-side-rpc" %}
+{% endif %}
\ No newline at end of file
diff --git a/_includes/templates/api/coap/server-side-rpc-certificate.md b/_includes/templates/api/coap/server-side-rpc-certificate.md
index 5a933ac823..062dc2e0cc 100644
--- a/_includes/templates/api/coap/server-side-rpc-certificate.md
+++ b/_includes/templates/api/coap/server-side-rpc-certificate.md
@@ -1,15 +1,16 @@
Send GET request with observe flag to the following URL:
-{% if docsPrefix == null or docsPrefix == "pe/"%}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/rpc
+coap://{{HOST_NAME}}/api/v1/rpc
```
{: .copy-code}
-Where **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address.
-
+> ⚠️ Where {{HOST_NAME}} is your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+
{% endif %}
{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
+
```shell
coap://{{coapHostName}}/api/v1/rpc
```
@@ -30,22 +31,23 @@ Once subscribed, a client may receive RPC requests. An example of RPC request bo
}
```
-Where
+> Where
+ • **id** - request id, integer request identifier
+ • **method** - RPC method name, string
+ • **params** - RPC method params, custom json object
-- **id** - request id, integer request identifier;
-- **method** - RPC method name, string;
-- **params** - RPC method params, custom json object.
+To reply to an RPC request, send a POST request to the following URL
-and can reply to them using POST request to the following URL:
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
-{% if docsPrefix == null or docsPrefix == "pe/"%}
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/rpc/{$id}
+coap://{{HOST_NAME}}/api/v1/rpc/{$id}
```
{: .copy-code}
{% endif %}
{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
+
```shell
coap://{{coapHostName}}/api/v1/rpc/{$id}
```
@@ -53,37 +55,30 @@ coap://{{coapHostName}}/api/v1/rpc/{$id}
{% endif %}
-Where **$id** is an integer request identifier.
+> Where $id is an integer request identifier.
$THINGSBOARD_HOST_NAME with your host:
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap-client -m get coap://$THINGSBOARD_HOST_NAME/api/v1/rpc -s 100 -B 100
+coap-client -m get coap://{{HOST_NAME}}/api/v1/rpc -s 100 -B 100
```
{: .copy-code}
+
{% endif %}
{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
-- Subscribe to RPC commands from the server using the command below:
```shell
coap-client -m get coap://{{coapHostName}}/api/v1/rpc -s 100 -B 100
```
{: .copy-code}
{% endif %}
-{% if docsPrefix == "edge/" %}
-- Subscribe to RPC commands from the server using the command below. Don't forget to replace $THINGSBOARD_EDGE_HOST_NAME with your host:
-
-```shell
-coap-client -m get coap://$THINGSBOARD_EDGE_HOST_NAME/api/v1/rpc -s 100 -B 100
-```
-{: .copy-code}
-{% endif %}
{% capture difference %}
The "`s`" option stands for subscribe and the value has to be specified in seconds.
@@ -92,30 +87,27 @@ The "`B`" options stands for break (the operation will be break after desired ti
{% endcapture %}
{% include templates/info-banner.md content=difference %}
-- Send an RPC request "connect" to the device using **RPC debug terminal** widget;
-
-- Save the "[rpc-response.json](/docs/reference/resources/rpc-response.json)" file to your PC;
-
+- Send an RPC request "connect" to the device using **RPC debug terminal** widget.
+- Save the [rpc-response.json](/docs/reference/resources/rpc-response.json){:target="_blank" download="rpc-response.json"} file to your PC.
- In the second terminal window simulate sending a response from the device to the server:
-{% if docsPrefix == null or docsPrefix == "pe/" %}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap-client -f rpc-response.json -m post coap://$THINGSBOARD_HOST_NAME/api/v1/rpc/1
+coap-client -f rpc-response.json -m post coap://{{HOST_NAME}}/api/v1/rpc/1
```
{: .copy-code}
+
+> ⚠️ Replace {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+
+
{% endif %}
{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
+
```shell
cat rpc-response.json | coap post coap://{{coapHostName}}/api/v1/rpc/1
```
{: .copy-code}
{% endif %}
-{% if docsPrefix == "edge/" %}
-```shell
-coap-client -f rpc-response.json -m post coap://$THINGSBOARD_EDGE_HOST_NAME/api/v1/rpc/1
-```
-{: .copy-code}
-{% endif %}
- You should receive a response from the device:
@@ -123,4 +115,6 @@ coap-client -f rpc-response.json -m post coap://$THINGSBOARD_EDGE_HOST_NAME/api/
{"result":"ok"}
```
-{% include images-gallery.html imageCollection="server-side-rpc-certificate" %}
\ No newline at end of file
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "paas/" or docsPrefix == "paas/eu/" %}
+{% include images-gallery.html imageCollection="server-side-rpc-certificate" %}
+{% endif %}
\ No newline at end of file
diff --git a/_includes/templates/api/coap/subscribe-to-attribute-updates-access-token.md b/_includes/templates/api/coap/subscribe-to-attribute-updates-access-token.md
index 4768e59523..29d66a4c59 100644
--- a/_includes/templates/api/coap/subscribe-to-attribute-updates-access-token.md
+++ b/_includes/templates/api/coap/subscribe-to-attribute-updates-access-token.md
@@ -1,22 +1,39 @@
Send GET request with Observe option to the following URL:
-{% if docsPrefix == null or docsPrefix == "pe/"%}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/attributes
+coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/attributes
```
{: .copy-code}
-Where
-- **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address;
-- **$ACCESS_TOKEN** is device access token.
+{% else %}
-{% endif %}
-{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
```shell
coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/attributes
```
{: .copy-code}
-Where **$ACCESS_TOKEN** is device access token.
+{% endif %}
+
+> ⚠️ Don't forget to replace {% unless docsPrefix contains "paas/" %}
+ • {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN with your device's access token.
+
+Once shared attribute will be changed by one of the server-side components (REST API or Rule Chain) the client will receive the following update:
+
+**Execute the command:**
+
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
+```shell
+coap get -o coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/attributes
+```
+{: .copy-code}
+
+{% else %}
+
+```shell
+coap get -o coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/attributes
+```
+{: .copy-code}
{% endif %}
\ No newline at end of file
diff --git a/_includes/templates/api/coap/subscribe-to-attribute-updates-certificate.md b/_includes/templates/api/coap/subscribe-to-attribute-updates-certificate.md
index 521108d3c8..520086bdb2 100644
--- a/_includes/templates/api/coap/subscribe-to-attribute-updates-certificate.md
+++ b/_includes/templates/api/coap/subscribe-to-attribute-updates-certificate.md
@@ -1,18 +1,37 @@
Send GET request with Observe option to the following URL:
-{% if docsPrefix == null or docsPrefix == "pe/"%}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/attributes
+coap://{{HOST_NAME}}/api/v1/attributes
```
{: .copy-code}
-Where **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address.
+> ⚠️ Don't forget to replace {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+
+{% else %}
-{% endif %}
-{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
```shell
coap://{{coapHostName}}/api/v1/attributes
```
{: .copy-code}
+{% endif %}
+
+Once shared attribute will be changed by one of the server-side components (REST API or Rule Chain) the client will receive the following update:
+
+**Execute the command:**
+
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
+```shell
+coap get -o coap://{{HOST_NAME}}/api/v1/attributes
+```
+{: .copy-code}
+
+{% else %}
+
+```shell
+coap get -o coap://{{coapHostName}}/api/v1/attributes
+```
+{: .copy-code}
+
{% endif %}
\ No newline at end of file
diff --git a/_includes/templates/api/coap/telemetry-upload-api-access-token.md b/_includes/templates/api/coap/telemetry-upload-api-access-token.md
index 091698e3e9..17429ffd00 100644
--- a/_includes/templates/api/coap/telemetry-upload-api-access-token.md
+++ b/_includes/templates/api/coap/telemetry-upload-api-access-token.md
@@ -1,23 +1,20 @@
Send POST request to the following URL:
-{% if (docsPrefix == null) or (docsPrefix == "pe/") %}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/$ACCESS_TOKEN/telemetry
+coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/telemetry
```
{: .copy-code}
-Where
-- **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address;
-- **$ACCESS_TOKEN** is device access token.
-
-{% endif %}
-{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
+{% else %}
```shell
coap://{{coapHostName}}/api/v1/$ACCESS_TOKEN/telemetry
```
{: .copy-code}
-Where **$ACCESS_TOKEN** is device access token.
+{% endif %}
-{% endif %}
\ No newline at end of file
+> ⚠️ Don't forget to replace {% unless docsPrefix contains "paas/" %}
+ • {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
+ • {% endunless %}$ACCESS_TOKEN with your device's access token.
\ No newline at end of file
diff --git a/_includes/templates/api/coap/telemetry-upload-api-certificate.md b/_includes/templates/api/coap/telemetry-upload-api-certificate.md
index fc3695e81f..6902f18059 100644
--- a/_includes/templates/api/coap/telemetry-upload-api-certificate.md
+++ b/_includes/templates/api/coap/telemetry-upload-api-certificate.md
@@ -1,19 +1,18 @@
Send POST request to the following URL:
-{% if (docsPrefix == null) or (docsPrefix == "pe/") %}
+{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
-coap://$THINGSBOARD_HOST_NAME/api/v1/telemetry
+coap://{{HOST_NAME}}/api/v1/telemetry
```
{: .copy-code}
-Where **$THINGSBOARD_HOST_NAME** is your localhost, or the platform address.
+> ⚠️ Don't forget to replace {{HOST_NAME}} with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
-{% endif %}
-{% if docsPrefix == "paas/" or docsPrefix == "paas/eu/"%}
+{% else %}
```shell
coap://{{coapHostName}}/api/v1/telemetry
```
{: .copy-code}
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git a/docs/edge/reference/coap-api.md b/docs/edge/reference/coap-api.md
index d08c8990f7..ff7b26cfd4 100644
--- a/docs/edge/reference/coap-api.md
+++ b/docs/edge/reference/coap-api.md
@@ -4,4 +4,6 @@ title: CoAP Device API Reference
redirect_from: "/docs/edge/reference/coap-api"
---
+{% assign docsPrefix = "edge/" %}
+{% include get-hosts-name.html docsTag="edge" %}
{% include docs/reference/coap-api.md %}
diff --git a/docs/edge/reference/http-api.md b/docs/edge/reference/http-api.md
index 32a913a881..e1776099ac 100644
--- a/docs/edge/reference/http-api.md
+++ b/docs/edge/reference/http-api.md
@@ -5,4 +5,6 @@ description: Supported HTTP API Reference for IoT Devices
redirect_from: "/docs/edge/reference/http-api"
---
+{% assign docsPrefix = "edge/" %}
+{% include get-hosts-name.html docsTag="edge" %}
{% include docs/reference/http-api.md %}
diff --git a/docs/edge/reference/lwm2m-api.md b/docs/edge/reference/lwm2m-api.md
index ec00a498aa..99ba892854 100644
--- a/docs/edge/reference/lwm2m-api.md
+++ b/docs/edge/reference/lwm2m-api.md
@@ -161,4 +161,6 @@ deviceNoSec_create_save:
---
+{% assign docsPrefix = "edge/" %}
+{% include get-hosts-name.html docsTag="edge" %}
{% include docs/reference/lwm2m-api.md %}
\ No newline at end of file
diff --git a/docs/edge/reference/mcp-server.md b/docs/edge/reference/mcp-server.md
index 9c6ef2f93a..f7efa47eba 100644
--- a/docs/edge/reference/mcp-server.md
+++ b/docs/edge/reference/mcp-server.md
@@ -6,4 +6,5 @@ description: Provides a **natural language interface** for LLMs and AI agents to
---
{% assign docsPrefix = "edge/" %}
+{% include get-hosts-name.html docsTag="edge" %}
{% include docs/reference/mcp-server.md %}
diff --git a/docs/edge/reference/mqtt-api.md b/docs/edge/reference/mqtt-api.md
index 4396b6c17d..458730baff 100644
--- a/docs/edge/reference/mqtt-api.md
+++ b/docs/edge/reference/mqtt-api.md
@@ -6,4 +6,5 @@ redirect_from: "/docs/edge/reference/mqtt-api"
---
{% assign docsPrefix = "edge/" %}
+{% include get-hosts-name.html docsTag="edge" %}
{% include docs/reference/mqtt-api.md %}
\ No newline at end of file
diff --git a/docs/edge/reference/resources/mqtt-js-attributes-request.js b/docs/edge/reference/resources/mqtt-js-attributes-request.js
index 21e294047d..0209cbb7f4 100644
--- a/docs/edge/reference/resources/mqtt-js-attributes-request.js
+++ b/docs/edge/reference/resources/mqtt-js-attributes-request.js
@@ -1,5 +1,5 @@
var mqtt = require('mqtt')
-var client = mqtt.connect('mqtt://localhost',{
+var client = mqtt.connect('mqtt://localhost', {
username: process.env.TOKEN
})
diff --git a/docs/edge/reference/snmp-api.md b/docs/edge/reference/snmp-api.md
index d5287de8df..4ec4a555a7 100644
--- a/docs/edge/reference/snmp-api.md
+++ b/docs/edge/reference/snmp-api.md
@@ -41,4 +41,6 @@ deviceProfileConfiguring5:
image: /images/reference/snmp-api/snmp-api-device-profile-configuring-6-pe.png
---
+{% assign docsPrefix = "edge/" %}
+{% include get-hosts-name.html docsTag="edge" %}
{% include docs/reference/snmp-api.md %}
\ No newline at end of file
diff --git a/docs/paas/eu/reference/resources/mqtt-js-attributes-request.js b/docs/paas/eu/reference/resources/mqtt-js-attributes-request.js
index 6f0dbeb34f..c50f2f963b 100644
--- a/docs/paas/eu/reference/resources/mqtt-js-attributes-request.js
+++ b/docs/paas/eu/reference/resources/mqtt-js-attributes-request.js
@@ -1,5 +1,5 @@
var mqtt = require('mqtt')
-var client = mqtt.connect('mqtt://{{hostName}}',{
+var client = mqtt.connect('mqtt://eu.thingsboard.cloud', {
username: process.env.TOKEN
})
diff --git a/docs/paas/reference/resources/mqtt-js-attributes-request.js b/docs/paas/reference/resources/mqtt-js-attributes-request.js
index 6f0dbeb34f..e034eeb134 100644
--- a/docs/paas/reference/resources/mqtt-js-attributes-request.js
+++ b/docs/paas/reference/resources/mqtt-js-attributes-request.js
@@ -1,5 +1,5 @@
var mqtt = require('mqtt')
-var client = mqtt.connect('mqtt://{{hostName}}',{
+var client = mqtt.connect('mqtt://thingsboard.cloud', {
username: process.env.TOKEN
})
diff --git a/docs/pe/edge/reference/coap-api.md b/docs/pe/edge/reference/coap-api.md
index af524bf920..0187746a48 100644
--- a/docs/pe/edge/reference/coap-api.md
+++ b/docs/pe/edge/reference/coap-api.md
@@ -4,5 +4,6 @@ title: CoAP Device API Reference
redirect_from: "/docs/pe/edge/reference/coap-api"
---
-{% assign docsPrefix = "pe/" %}
+{% assign docsPrefix = "pe/edge/" %}
+{% include get-hosts-name.html docsTag="pe-edge" %}
{% include docs/reference/coap-api.md %}
diff --git a/docs/pe/edge/reference/http-api.md b/docs/pe/edge/reference/http-api.md
index ec5970be99..c012e7f51d 100644
--- a/docs/pe/edge/reference/http-api.md
+++ b/docs/pe/edge/reference/http-api.md
@@ -5,5 +5,6 @@ description: Supported HTTP API Reference for IoT Devices
redirect_from: "/docs/pe/edge/reference/http-api"
---
-{% assign docsPrefix = "pe/" %}
+{% assign docsPrefix = "pe/edge/" %}
+{% include get-hosts-name.html docsTag="pe-edge" %}
{% include docs/reference/http-api.md %}
diff --git a/docs/pe/edge/reference/lwm2m-api.md b/docs/pe/edge/reference/lwm2m-api.md
index bfabe9b032..44934c6f34 100644
--- a/docs/pe/edge/reference/lwm2m-api.md
+++ b/docs/pe/edge/reference/lwm2m-api.md
@@ -161,5 +161,6 @@ deviceNoSec_create_save:
---
-{% assign docsPrefix = "pe/" %}
+{% assign docsPrefix = "pe/edge/" %}
+{% include get-hosts-name.html docsTag="pe-edge" %}
{% include docs/reference/lwm2m-api.md %}
\ No newline at end of file
diff --git a/docs/pe/edge/reference/mcp-server.md b/docs/pe/edge/reference/mcp-server.md
index 7c226c3ed2..890d27290e 100644
--- a/docs/pe/edge/reference/mcp-server.md
+++ b/docs/pe/edge/reference/mcp-server.md
@@ -6,4 +6,5 @@ description: Provides a **natural language interface** for LLMs and AI agents to
---
{% assign docsPrefix = "pe/edge/" %}
+{% include get-hosts-name.html docsTag="pe-edge" %}
{% include docs/reference/mcp-server.md %}
diff --git a/docs/pe/edge/reference/mqtt-api.md b/docs/pe/edge/reference/mqtt-api.md
index 183ffa3fba..fb81f5d328 100644
--- a/docs/pe/edge/reference/mqtt-api.md
+++ b/docs/pe/edge/reference/mqtt-api.md
@@ -6,4 +6,5 @@ redirect_from: "/docs/pe/edge/reference/mqtt-api"
---
{% assign docsPrefix = "pe/edge/" %}
+{% include get-hosts-name.html docsTag="pe-edge" %}
{% include docs/reference/mqtt-api.md %}
\ No newline at end of file
diff --git a/docs/pe/edge/reference/resources/mqtt-js-attributes-request.js b/docs/pe/edge/reference/resources/mqtt-js-attributes-request.js
index 21e294047d..0209cbb7f4 100644
--- a/docs/pe/edge/reference/resources/mqtt-js-attributes-request.js
+++ b/docs/pe/edge/reference/resources/mqtt-js-attributes-request.js
@@ -1,5 +1,5 @@
var mqtt = require('mqtt')
-var client = mqtt.connect('mqtt://localhost',{
+var client = mqtt.connect('mqtt://localhost', {
username: process.env.TOKEN
})
diff --git a/docs/pe/edge/reference/snmp-api.md b/docs/pe/edge/reference/snmp-api.md
index ade1660eec..0c604a6831 100644
--- a/docs/pe/edge/reference/snmp-api.md
+++ b/docs/pe/edge/reference/snmp-api.md
@@ -41,5 +41,6 @@ deviceProfileConfiguring5:
image: /images/reference/snmp-api/snmp-api-device-profile-configuring-6-pe.png
---
-{% assign docsPrefix = "pe/" %}
+{% assign docsPrefix = "pe/edge/" %}
+{% include get-hosts-name.html docsTag="pe-edge" %}
{% include docs/reference/snmp-api.md %}
\ No newline at end of file
diff --git a/docs/reference/resources/mqtt-js-attributes-request.js b/docs/reference/resources/mqtt-js-attributes-request.js
index 21e294047d..0209cbb7f4 100644
--- a/docs/reference/resources/mqtt-js-attributes-request.js
+++ b/docs/reference/resources/mqtt-js-attributes-request.js
@@ -1,5 +1,5 @@
var mqtt = require('mqtt')
-var client = mqtt.connect('mqtt://localhost',{
+var client = mqtt.connect('mqtt://localhost', {
username: process.env.TOKEN
})