Using HTTPS For Access
Overview
Hypertext Transfer Protocol Secure (HTTPS) is a secure communication protocol that uses the SSL encryption over the HTTP protocol. It is supported by IoTDA.
Constraints
Item |
Limit |
---|---|
Supported HTTP version |
HTTP 1.0 HTTP 1.1 |
Supported HTTPS |
The IoT platform supports only the HTTPS protocol. For details about how to download a certificate, see Certificates. |
Supported TLS version |
TLS 1.2 |
Maximum body length |
1 MB |
API specifications |
For details, see Specifications. |
Maximum number of child devices of which properties can be reported by a gateway at a time |
50 |
API Calling
For details about the platform endpoint, see Platform Connection Information.
Use the endpoint of IoTDA and the HTTPS port number 443.
Communication Between HTTPS Devices and the Platform
When a device connects to the platform through HTTPS, HTTPS APIs are used for their communication. These APIs can be used for device authentication as well as message and property reporting.
Message Type |
Description |
---|---|
Device authentication |
Devices obtain access tokens. |
Device reporting properties |
Devices report property data in the format defined in the product model. |
Device reporting messages |
Devices report custom data to IoTDA, which then forwards reported messages to an application or other Huawei Cloud services for storage and processing. |
Gateway reporting device properties in batches |
A gateway reports property data of multiple child devices to the platform. |
Service Flow
- Create a product on the IoTDA console or by calling the API for creating a product.
- Register a device on the IoTDA console or calling the API Creating a Device.
- Call the device authentication API to obtain the access token of the device.
- Enter device ID and secret, and obtain the timestamp and encrypted password.
- Edit the JSON authentication message body based on Table 1. Figure 2 is an example.
Table 1 JSON authentication message body Item
Content
device_id
Device ID.
sign_type
The recommended value is 0, indicating that the system does not check whether the message timestamp is the same as the platform time and only checks whether the password is correct.
timestamp
Timestamp, for example, 2024062602. Obtain the value based on the client ID in Figure 1.
password
Encrypted password, which is the value of Password in Figure 1.
- Obtain the access address by referring to Platform Connection Information, combine the access address into a URL by referring to Figure 2, and send the URL to obtain the access_token.
- The obtained access token can be used by devices to report messages and properties. The access token is in the message header. The following uses property reporting as an example.
Figure 3 Reporting properties
Figure 4 Reporting properties
HTTP APIs
The following table describes the platform APIs.
API Category |
Function |
API |
---|---|---|
Device authentication API |
/v5/device-auth |
|
Device message reporting API |
/v5/devices/{device_id}/sys/messages/up |
|
Device property reporting APIs |
/v5/devices/{device_id}/sys/properties/report |
|
/v5/devices/{device_id}/sys/gateway/sub-devices/properties/report |
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