Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _data/host-constant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
196 changes: 109 additions & 87 deletions _includes/docs/reference/coap-api.md

Large diffs are not rendered by default.

492 changes: 238 additions & 254 deletions _includes/docs/reference/http-api.md

Large diffs are not rendered by default.

68 changes: 37 additions & 31 deletions _includes/docs/reference/mqtt-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ ThingsBoard supports multiple authentication mechanisms to secure MQTT connectio

Topic names and payload formats for MQTT communication are configured via the **Device profile**. For more details, see [here](/docs/user-guide/device-profiles/#mqtt-transport-type){:target="_blank"}.

> **Note**
This guide uses **access token–based authentication**.
> The examples in this guide use **access token–based authentication**.

<hr>

Expand All @@ -79,10 +78,10 @@ mosquitto_pub -d -q 1 -h "{{mqttHostName}}" -p "1883" -t "v1/devices/me/telemetr
{: .copy-code}

{% endif %}
{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge" %}
{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}

> ⚠️ **Don&#39;t forget to replace:**
> &#8194;&#8226;&#8194;<code>{{HOST_NAME}}</code> with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge" %} Edge{% endif %} hostname or IP address.
> &#8194;&#8226;&#8194;<code>{{HOST_NAME}}</code> with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
> &#8194;&#8226;&#8194;<code>$ACCESS_TOKEN</code> with your device&#39;s access token.

```bash
Expand All @@ -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, <code>{{HOST_NAME}}</code> refers to your <code>local</code> ThingsBoard {% if docsPrefix == "edge/" or docsPrefix == "pe/edge" %}Edge {% endif %}installation, and <code>$ACCESS_TOKEN</code> is set to <code>ABC123</code>.
In this example, <code>{{HOST_NAME}}</code> refers to your <code>local</code> ThingsBoard {% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}Edge {% endif %}installation, and <code>$ACCESS_TOKEN</code> is set to <code>ABC123</code>.

```bash
mosquitto_pub -d -q 1 -h "localhost" -p "1883" -t "v1/devices/me/telemetry" -u "ABC123" -m {"temperature":25}
Expand Down Expand Up @@ -279,7 +278,7 @@ v1/devices/me/attributes
```
{: .copy-code}

<br><b><font size="3">Examples</font></b>
<b><font size="3">Examples</font></b>
Below are the examples of how to publish client-side device attributes.

> ⚠️ Don&#39;t forget to replace {% unless docsPrefix contains "paas/" %}
Expand All @@ -298,9 +297,9 @@ Telemetry data:

Execute the command:

{% if docsPrefix == null or docsPrefix == "pe/" %}
{% if docsPrefix == nil or docsPrefix == "pe/" or docsPrefix == "edge/" or docsPrefix == "pe/edge/" %}
```shell
mosquitto_pub -d -h "$THINGSBOARD_HOST_NAME" -t "v1/devices/me/attributes" -u "$ACCESS_TOKEN" -m "{"attribute1": "value1", "attribute2": true}"
mosquitto_pub -d -h "{{HOST_NAME}}" -t "v1/devices/me/attributes" -u "$ACCESS_TOKEN" -m "{"attribute1": "value1", "attribute2": true}"
```
{: .copy-code}
{% else %}
Expand Down Expand Up @@ -358,23 +357,14 @@ v1/devices/me/attributes/response/+
The following example is written in javascript and is based on mqtt.js.
Pure command-line examples are not available because subscribe and publish need to happen in the same mqtt session.

{% if docsPrefix == nil or docsPrefix == "pe/" %}
**1.** Save the [mqtt-js-attributes-request.js](/docs/pe/reference/resources/mqtt-js-attributes-request.js){:target="_blank" download="mqtt-js-attributes-request.js"} file to your PC.
**1.** Save the [mqtt-js-attributes-request.js](/docs/{{docsPrefix}}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 installation**.
> If your ThingsBoard instance is deployed on a different host, make sure to replace <code>localhost</code> 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 <code>localhost</code> 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 <code>localhost</code> 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 %}
Expand Down Expand Up @@ -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 <code>$REQUEST_ID</code> is an integer request identifier.

The response from server will be published to the following topic:

```shell
Expand Down Expand Up @@ -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}

Expand All @@ -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" %}
Expand Down Expand Up @@ -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:

Expand All @@ -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
Expand All @@ -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
{
Expand All @@ -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.

<hr>

## Firmware API
Expand Down
9 changes: 6 additions & 3 deletions _includes/docs/user-guide/ssl/http-access-token.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
* TOC
{:toc}

Access Token Based Authentication is the default device authentication type. Once the device is created in ThingsBoard, the default access token is generated. It can be changed afterwards.
In order to connect the device to a server using Access Token based authentication, the client must specify the access token as part of HTTP request URL.
See [HTTP API](/docs/{{docsPrefix}}reference/coap-api/) for more details. There are no specific examples, since all modern HTTP clients support HTTPS as well.
Access token–based authentication is the default authentication method for devices in ThingsBoard.
When a device is created, ThingsBoard automatically generates a unique access token. This token can be [updated](/docs/{{docsPrefix}}user-guide/ui/devices/#manage-device-credentials){:target="_blank"} later in the device details.

To authenticate a device over HTTP, the client must include the access token as part of the HTTP request URL.

For details about supported endpoints, request formats, and payloads, refer to the [HTTP API](/docs/{{docsPrefix}}reference/http-api/){:target="_blank"} documentation.
28 changes: 19 additions & 9 deletions _includes/docs/user-guide/ui/devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,25 @@ Second way:

## Check connectivity

To verify if your device is successfully connected to ThingsBoard:
- Open the "**Device details**" window and click "**Check connectivity**".
- Select:
- [Communication protocol](/docs/{{docsPrefix}}reference/protocols/){:target="_blank"} ([MQTT](/docs/{{docsPrefix}}reference/mqtt-api){:target="_blank"}, [HTTP](/docs/{{docsPrefix}}reference/http-api){:target="_blank"}, etc.)
- Operating system
- If required, install the necessary client tools.
- Copy the generated command and run it in a **Terminal**.

If successful, the device status will change from "**Inactive**" to "**Active**", and telemetry data (e.g., temperature) will appear.
**Check connectivity** is a built-in feature that provides ready-to-use commands for testing device connectivity to ThingsBoard using different communication protocols. It allows you to quickly verify network access, validate credentials, and confirm that incoming telemetry is processed correctly.

Using this feature, you can publish test telemetry data (for example, a temperature value of 25) and immediately ensure that the device is able to communicate with the platform.

**To verify device connectivity:**
1. Click on device to open its details page.
2. Click **Check connectivity**.
3. Select the [communication protocol](/docs/{{docsPrefix}}reference/protocols/){:target="_blank"} ([MQTT](/docs/{{docsPrefix}}reference/mqtt-api){:target="_blank"}, [HTTP](/docs/{{docsPrefix}}reference/http-api){:target="_blank"}, etc.) and your operating system.
4. Copy the generated command and execute it in a terminal.

If the connection is successful:
- The device status changes from **Inactive** to **Active**.
- Telemetry data appears on the **Latest telemetry** tab.

{% capture difference %}
For guidance on connecting devices based on your technology stack, see the available [connection guides](/docs/guides/#AnchorIDGettingStartedGuides){:target="_blank"}.<br>
For advanced protocols and API options, refer to the [ThingsBoard API reference](/docs/{{docsPrefix}}reference/protocols/){:target="_blank"}.
{% endcapture %}
{% include templates/info-banner.md content=difference %}

{% include images-gallery.html imageCollection="check-connectivity" %}

Expand Down
16 changes: 8 additions & 8 deletions _includes/templates/api/coap/claiming-devices-access-token.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
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/claim
coap://{{HOST_NAME}}/api/v1/$ACCESS_TOKEN/claim
```
{: .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/claim
```
{: .copy-code}

Where **$ACCESS_TOKEN** is device access token.
{% endif %}

{% endif %}
> ⚠️ Don&#39;t forget to replace {% unless docsPrefix contains "paas/" %}
&#8194;&#8226;&#8194;<code>{{HOST_NAME}}</code> with your ThingsBoard{% if docsPrefix == "edge/" or docsPrefix == "pe/edge/" %} Edge{% endif %} hostname or IP address.
&#8194;&#8226;&#8194;{% endunless %}<code>$ACCESS_TOKEN</code> with your device&#39;s access token.
8 changes: 5 additions & 3 deletions _includes/templates/api/coap/claiming-devices-certificate.md
Original file line number Diff line number Diff line change
@@ -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&#39;t forget to replace <code>{{HOST_NAME}}</code> 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
```
Expand Down
Loading