<< thingsboard_getData bytecode_iot_module thingsboard_getDevices >>

bytecode_iot_module >> bytecode_iot_module > thingsboard_getDeviceToken

thingsboard_getDeviceToken

Retrieve a device's token

Syntax

[devicetoken,code] = thingsboard_getDeviceToken(url,token,deviceID)

Parameters

url :

The ThingsBoard platform url

token :

Thingsboard token

deviceID :

Device id

devicetoken :

The device's token

code :

Status code

Description

Retrieves a device's token. This token is needed in order to push data to the device. Note that this token is different from the thingsboard_getToken's token.

Examples

// If you want to push data to a device with id ABC123
data = create_JSON("temp",24,"humidity",55)
token = thingsboard_getToken(url,user,pw)
[devicetoken,code] = thingsboard_getDeviceToken(url,token,"ABC123")
n = thingsboard_postData(url,devicetoken,data)

See also

Authors


Report an issue
<< thingsboard_getData bytecode_iot_module thingsboard_getDevices >>