Using HTTPS to Access IoT Platform from a Device

Image for post
Image for post

HTTPS Access to IoT Platform from a Device

The IoT platform supports HTTPS access from a device only in China (Shanghai). For more information on the access flow for communication using HTTP connections refer to this document.

1) Device Authentication: Token Acquisition Based on Trituple Information

To begin with, view the HTTPS server endpoint.

Consider the following sample authentication request.

The following snippet shows the sample response.

2) Device Data Reporting

The HTTPS server endpoint is at https://iot-as-http.cn-shanghai.aliyuncs.com/topic/${topic}.

Consider the following sample request.

The preceding sample request shows the following response.

3) Node.js Case Study

Let’s take a quick look at the case study for Node.js. The following sections describe the various steps.

3.1 Create an Advanced Product

Refer to the following snapshot to create an advanced product.

3.2 Define Functions

Next, add product property definitions as listed in the following table.

3.3 Register a Device and Obtain Identity Trituple Information on the Devices Page

Obtain identity trituple information on the device page post registering a device as shown below.

3.4 Run Device Simulation Code

Now, execute the following device simulation code.

3.5 View Code Execution Results

Once the preceding code successfully executes, navigate to the following screen to finally view the results.

Original Source:

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store