ProductId
, DeviceName
, and TopicName
to initiate an http/https
request to the platform. The request API and parameters are as detailed below:https://ap-guangzhou.gateway.tencentdevices.com/device/publish
http://ap-guangzhou.gateway.tencentdevices.com/device/publish
Parameter | Required | Type | Description |
ProductId | Yes | String | Product ID |
DeviceName | Yes | String | Device name |
TopicName | Yes | String | Name of the topic for publishing the message |
Payload | Yes | String | Content of the published message |
PayloadEncoding | No | String | Encoding for the published message. Currently, only Base64-encoding is supported. If this parameter is left empty, the original message content will be sent. |
Qos | Yes | Integer | Message QoS level |
application/json
format.Parameter | Type | Description |
RequestId | String | Request ID |
POST https://ap-guangzhou.gateway.tencentdevices.com/device/publishContent-Type: application/jsonHost: ap-guangzhou.gateway.tencentdevices.comX-TC-Algorithm: HmacSha256X-TC-Timestamp: 155****065X-TC-Nonce: 5456X-TC-Signature: 2230eefd229f582d8b1b891af7107b915972407****78ab3738f756258d7652c{"DeviceName":"AAAAAA","Payload":"123","ProductId":"G8N****AHB","Qos":1,"TopicName":"G8N****AHB/AAAAAA/data"}
{"Response": {"RequestId": "f4da4f1f-d72e-40f1-****-349fc0072ba0"}}