Help Center>
IoT Device Access>
User Guide>
Message Communications>
Data Delivery>
Property Delivery>
Property Delivery Usage
Updated on 2023-10-18 GMT+08:00
Property Delivery Usage
Property delivery is used for property modification or query. The following uses property modification as an example.
Description
Figure 1 Process of property delivery
![Click to enlarge](https://support.huaweicloud.com/intl/en-us/usermanual-iothub/figure/en-us_image_0000001604551661.png)
- An application calls the API for modifying device properties to deliver a request to the platform. Example message:
PUT https://{endpoint}/v5/iot/{project_id}/devices/{device_id}/properties { "services" : [ { "service_id" : "Temperature", "properties" : { "value" : 57 } }, { "service_id" : "Battery", "properties" : { "level" : 80 } } ] }
- The platform sends the property to the device according to the protocol specifications. The following is an example of setting properties through the APIs for MQTT devices.
Topic: $oc/devices/{device_id}/sys/properties/set/request_id={request_id} Data format: { "object_device_id": "{object_device_id} ", "services": [ { "service_id": "Temperature", "properties": { "value": 57, "value2": 60 } }, { "service_id": "Battery", "properties": { "level": 80, "level2": 90 } } ] }
- The device executes the command and returns the execution result. Example message:
Topic: $oc/devices/{device_id}/sys/properties/set/response/request_id={request_id} Data format: { "result_code": 0, "result_desc": "success" }
- The platform synchronously sends a response to the HTTP command. Example message:
Status Code: 200 OK Content-Type: application/json { "response" : { "result_code" : 0, "result_desc" : "success" } }
Parent topic: Property Delivery
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.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot