Push a Device Addition Notification
Function
This API is used by the platform to push a device addition notification to an application after the application calls the APIs for Creating A Rule Triggering Condition (resource is set to device and event to create), Creating A Rule Action, and Modifying a Rule Triggering Condition to configure and activate a rule.
Precautions
The application must send a response code after receiving a message pushed by the platform.
URI
Request Method |
POST |
---|---|
URI |
HTTP URL determined when the application creates the device addition notification rule. The AMQP channel does not require the URL. |
Transport Protocol |
HTTPS |
Request Parameters
Parameter |
Mandatory |
Type |
Location |
Description |
---|---|---|---|---|
resource |
Yes |
String |
Body |
Subscribed resource name. Set this parameter to device. |
event |
Yes |
String |
Body |
Subscribed event. Set this parameter to create. |
event_time |
Yes |
String |
Body |
UTC time when the resource event was generated. The value is in the format of yyyyMMdd'T'HHmmss'Z', for example, 20151212T121212Z. If necessary, convert the time to display in the local time zone format. |
event_time_ms |
No |
String |
Body |
Time when a resource event is generated. The value is a UTC character string in the format of yyyy-MM-dd'T'HH:mm:ss.SSS'Z', for example, 2015-12-12T12:12:12.000Z. If necessary, convert the time to display in the local time zone format. |
request_id |
No |
String |
Body |
Message ID which is specified by the device or generated by the platform and is used to trace the service process. |
notify_data |
Yes |
Body |
Message to push. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
body |
Yes |
QueryDeviceBase Object |
Message content. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
app_id |
No |
String |
Resource space ID. |
app_name |
No |
String |
Resource space name. |
device_id |
No |
String |
Device ID, which uniquely identifies a device. The value of this parameter is specified during device registration or allocated by the platform. If the value is allocated by the platform, the value is in the format of [product_id]_[node_id]. |
node_id |
No |
String |
Device identifier. This parameter is set to the IMEI, MAC address, or serial number. |
gateway_id |
No |
String |
Gateway ID, which is the device ID of the parent device. The gateway ID is the same as the device ID if the device is a directly connected device. If the device is an indirectly connected device, the gateway ID is the device ID of its parent device. |
device_name |
No |
String |
Device name. |
node_type |
No |
String |
Device node type.
|
description |
No |
String |
Device description. |
fw_version |
No |
String |
Firmware version of the device. |
sw_version |
No |
String |
Software version of the device. |
device_sdk_version |
No |
String |
SDK version of the device. |
auth_info |
No |
AuthInfo Object |
Access authentication information about the device. |
product_id |
No |
String |
Unique ID of the product associated with the device. |
product_name |
No |
String |
Name of the product associated with the device. |
status |
No |
String |
Device status.
|
create_time |
No |
String |
Time when the device was registered on the platform. The value is in the format of yyyyMMdd'T'HHmmss'Z', for example, 20151212T121212Z. |
extension_info |
No |
Object |
Extended device information, which can be customized. If this parameter is specified for a child device during device creation, the platform will notify the gateway of the extended information through the MQTT API used for notifying a gateway of new child device connection. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
auth_type |
No |
String |
Authentication type. Key authentication (SECRET) and certificate authentication (CERTIFICATES) are supported. If secret authentication is used, fill in secret. If certificate authentication is used, fill in fingerprint. If auth_type is not set, secret authentication is used by default. |
secure_access |
No |
Boolean |
Whether the device is connected to the platform using a secure protocol. The default value is true.
|
timeout |
No |
Integer |
Validity period of the device verification code, in seconds. The default value is 0. If the device has not been connected to the platform within the validity period, the platform deletes the registration information of the device. If this parameter is set to 0, the verification code is always valid. The recommended value is 0. Note: This parameter is returned only when timeout is modified in the device registration or modification API. |
Example Request
POST https://{Endpoint} HTTP URL determined when the application creates the device addition notification rule. The AMQP channel does not require the URL. Content-Type: application/json { "resource" : "device", "event" : "create", "event_time" : "20151212T121212Z", "event_time_ms" : "2015-12-12T12:12:12.000Z", "request_id" : "3fe58d5e-8697-4849-a165-7db128f7e776", "notify_data" : { "body" : { "device_sdk_version" : "C_v0.5.0", "device_id" : "d4922d8a-6c8e-4396-852c-164aefa6638f", "create_time" : "20190303T081011Z", "description" : "watermeter device", "auth_info" : { "auth_type" : "SECRET", "secure_access" : true, "timeout" : 300 }, "product_name" : "Thermometer", "gateway_id" : "d4922d8a-6c8e-4396-852c-164aefa6638f", "sw_version" : "1.1.0", "tags" : [ { "tag_value" : "testTagValue", "tag_key" : "testTagName" } ], "extension_info" : { "aaa" : "xxx", "bbb" : 0 }, "app_name" : "testAPP01", "device_name" : "dianadevice", "node_type" : "ENDPOINT", "product_id" : "b640f4c203b7910fc3cbd446ed437cbd", "app_id" : "jeQDJQZltU8iKgFFoW060F5SGZka", "fw_version" : "1.1.0", "node_id" : "ABC123456789", "status" : "INACTIVE" } } }
Example Response
Status Code: 200 OK
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot