Control the label to execute commands or actions
HTTP Request URL: http(s)://api.thingboot.com/{AppID}/tag/control/?sign={sign}&ts={ts}
About the sign and ts definition
Or
MQTT Publish Topic: api/{AppID}/tag/control
The returned results are also received on the same topic.
Request parameters
When the parameters are lengthy, it is recommended to use the POST method.
| Name | Type | Description |
|---|---|---|
| tag | int | Tag ID, the ID returned when reading the tag list.
When specifying multiple tags, please use a delimiter (, or |) to connect them.
When specifying multiple tags, devices belonging to different product categories are allowed, but they must share the same command.
For example: 10222 is a first-generation switch, and 10333 is a second-generation switch; both have the command power=1, so they can be specified simultaneously. |
| 命令或动作 | string | Only one of command or action can be specified at a time; choose one.
When specifying a command: the format is device attribute name=attribute value.
On the device details page, you can query the available commands and their corresponding values for the device.
For example, if power=1, the command will be sent to turn on the power attribute of all devices associated with the specified tag.
You can also wrap the attribute value in order, such as: order:{power:1}
When specifying an action: the format is action=action ID.
For example, if action=1, the action with ID 1 will be executed for the corresponding tag. |
Return example
Return results
| Name | Type | Description |
|---|---|---|
| code | int | 200 Correct
501 Tag ID not specified; the tag ID is an integer. This ID is output in the tag list interface and can also be viewed in the tag list on this console.
502 Tag does not exist or no devices are available. Please check whether the tag ID is correct and whether devices have been added to the tag.
504 No recognizable command. The function in the command does not exist. Please refer to the function list of the specified product in the product list to check the available functions.
50xx See "Global Error Codes" |
Return example