Quick Application Access
The platform provides a wealth of RESTful APIs to simplify application development and improve efficiency. This section uses Postman as an example to describe how to connect a simulated application to the platform through HTTPS.
Prerequisites
- You have registered a HUAWEI CLOUD account.
- You have completed real-name authentication on HUAWEI CLOUD.
- You have subscribed to the IoTDA service.
- You have obtained the Collection.
Creating a Product
A product is a collection of devices with the same capabilities or features. In addition to physical devices, a product includes product information, product models (profiles), and codecs generated when it is created on the platform.
- Log in to the IoTDA console.
- Choose Products in the navigation pane and click in the upper right corner.
- Set the parameters to create a product that uses MQTT, and click Create.
Set Basic Info
Resource Space
The platform automatically allocates the created product to the default resource space. If you want to allocate the product to another resource space, select the resource space from the drop-down list. If a resource space does not exist, create it first.
Product Name
Customize the product name. The value can contain letters, numbers, underscores (_), and hyphens (-).
Protocol
MQTT is recommended.
Data Type
Select JSON.
Manufacturer
Customize the manufacturer name. The value can contain letters, numbers, underscores (_), and hyphens (-).
Define Product Model
Product Model
You are advised to use a product model preset on the platform. For details about the application scenarios of the standard model and vendor model, click here.
Industry
Select the industry to which the product model belongs.
Device Type
If a product model preset on the platform is used, the device type is automatically matched and does not need to be manually specified.
Installing and Configuring Postman
- Install Postman.
- Visit the Postman website to download and install Postman. (Postman 7.17.0 is used as an example.)

- Postman requires the .NET Framework 4.5 component. If you do not have this component, click .NET Framework 4.5 to download and install it.
- To ensure successful API calls, you are advised to download Postman 7.17.0.
- Enter the email address, username, and password to register Postman.
- Visit the Postman website to download and install Postman. (Postman 7.17.0 is used as an example.)
- Import the Postman environment variables.
- Click
in the upper right corner. The MANAGE ENVIRONMENTS window is displayed. 
- Click Import to import the IoTDA.postman_environment.json file (obtained after the Collection package is decompressed).

- Click Manage Environments and select the imported IoTDA environment.


- Change the values of IAMEndpoint, IOTDAEndpoint, IAMUserName, IAMPassword, IAMDoaminId, and region.

- IAMEndpoint: Obtain the IAM endpoint from IAM Regions and Endpoints.
- IOTDAEndpoint: Obtain the IAM endpoint from IoT Platform Endpoints.
- If you have subscribed to IoTDA in CN North-Beijing4, change the IAM user name, login password, and account name by following the instructions provided in My Credentials.
- Return to the home page and set the environment variable to the imported IoTDA.
- Click
- Upload the API call (V5 version).postman_collection.json file.

After the file is uploaded, the dialog box shown in the following figure is displayed.

Debugging the API Used to Obtain the Token for an IAM User
Before accessing platform APIs, an application must call the API Obtaining the Token for an IAM User for authentication. After the authentication is successful, HUAWEI CLOUD returns the authentication token X-Subject-Token to the application.
To call this API, the application constructs an HTTP request. An example request is as follows:
POST https://iam.cn-north-4.myhuaweicloud.com/v3/auth/tokens
Content-Type: application/json
{
"auth": {
"identity": {
"methods": [
"password"
],
"password": {
"user": {
"name": "username",
"password": "********",
"domain": {
"name": "domainname"
}
}
}
},
"scope": {
"project": {
"name": "xxxxxxxx"
}
}
}
} Note: username indicates the IAM user name, password indicates the password for logging in to HUAWEI CLOUD, domainname indicates the account name, and projectname indicates the project name. You can obtain them from the My Credentials page.

Debug the API by following the instructions provided in Obtaining a User Token Through Password Authentication.
- Configure the HTTP method, URL, and headers of the API.

- Configure the body of the API.

- Click Send. The returned code and response are displayed in the lower part of the page.

- Use the returned X-Subject-Token value in the header field to update X-Auth-Token in the IoTDA environment so that it can be used in other API calls. If the token expires, the Authentication API must be called again to obtain a new token.

The X-Auth-Token parameter is automatically updated in Postman. You do not need to manually update it.

Debugging the API Listing Projects Accessible to an IAM User
Before accessing platform APIs, the application must call the API Listing Projects Accessible to an IAM User to obtain the project ID of the user.
To call this API, the application constructs an HTTP request. An example request is as follows:
GET https://iam.cn-north-4.myhuaweicloud.com/v3/auth/projects Content-Type: application/json X-Auth-Token: ********
Debug the API by following the instructions provided in Listing Projects Accessible to an IAM User.
- Configure the HTTP method, URL, and headers of the API.

- Click Send. The returned code and response are displayed in the lower part of the page.

- The returned body contains a list of projects. Search for the item whose name is the same as the value of region in the IoTDA environment, and use the id value to update project_id in the IoTDA environment so that it can be used in other API calls.


In this example, the project_id parameter is automatically updated in Postman. You do not need to manually update it.

Debugging the API Used to Create a Product
Before connecting a device to the platform, an application must call the API Creating a Product. The product created will be used during device registration.
To call this API, the application constructs an HTTP request. An example request is as follows:
POST https://iotda.cn-north-4.myhuaweicloud.com/v5/iot/{project_id}/products
Content-Type: application/json
X-Auth-Token: ********
{
"name" : "Thermometer",
"device_type" : "Thermometer",
"protocol_type" : "MQTT",
"data_format" : "binary",
"manufacturer_name" : "ABC",
"industry" : "smartCity",
"description" : "this is a thermometer produced by Huawei",
"service_capabilities" : [ {
"service_type" : "temperature",
"service_id" : "temperature",
"description" : "temperature",
"properties" : [ {
"unit" : "centigrade",
"min" : "1",
"method" : "R",
"max" : "100",
"data_type" : "decimal",
"description" : "force",
"step" : 0.1,
"enum_list" : [ "string" ],
"required" : true,
"property_name" : "temperature",
"max_length" : 100
} ],
"commands" : [ {
"command_name" : "reboot",
"responses" : [ {
"response_name" : "ACK",
"paras" : [ {
"unit" : "km/h",
"min" : "1",
"max" : "100",
"para_name" : "force",
"data_type" : "string",
"description" : "force",
"step" : 0.1,
"enum_list" : [ "string" ],
"required" : false,
"max_length" : 100
} ]
} ],
"paras" : [ {
"unit" : "km/h",
"min" : "1",
"max" : "100",
"para_name" : "force",
"data_type" : "string",
"description" : "force",
"step" : 0.1,
"enum_list" : [ "string" ],
"required" : false,
"max_length" : 100
} ]
} ],
"option" : "Mandatory"
} ],
"app_id" : "jeQDJQZltU8iKgFFoW060F5SGZka"
} Debug the API by following the instructions provided in Creating a Product.
Note: Only the parameters used in the debugging example are described in the following steps.
- Configure the HTTP method, URL, and headers of the API.

- Configure the body of the API.

- Click Send. The returned code and response are displayed in the lower part of the page.

- Use the returned product_id value to update the product_id parameter in the IoTDA environment so that it can be used in other API calls.

Note: The product_id parameter is automatically updated in Postman. You do not need to manually update it.

Debugging the API Creating a Device
Before connecting a device to the platform, an application must call the API Registering a Device. Then, the device can use the unique identification code to get authenticated and connect to the platform.
To call this API, the application constructs an HTTP request. An example request is as follows:
POST https://iotda.cn-north-4.myhuaweicloud.com/v5/iot/{project_id}/devices
Content-Type: application/json
X-Auth-Token: ********
{
"node_id" : "ABC123456789",
"device_name" : "dianadevice",
"product_id" : "b640f4c203b7910fc3cbd446ed437cbd",
"auth_info" : {
"auth_type" : "SECRET",
"secure_access" : true,
"fingerprint" : "dc0f1016f495157344ac5f1296335cff725ef22f",
"secret" : "3b935a250c50dc2c6d481d048cefdc3c",
"timeout" : 300
},
"description" : "watermeter device"
} Debug the API by following the instructions provided in Creating a Device.
Note: Only the parameters used in the debugging example are described in the following steps.
- Configure the HTTP method, URL, and headers of the API.

- Configure the body of the API.

- Click Send. The returned code and response are displayed in the lower part of the page.

- Use the returned device_id value to update the device_id parameter in the IoTDA environment so that it can be used in other API calls.

Note: The device_id parameter is automatically updated in Postman. You do not need to manually update it.

Advanced Experience
After using Postman to connect a simulated application to the platform, you may understand how the application interacts with the platform through open APIs.
To better experience the IoTDA service, develop real-world applications and devices and connect them to the platform. For details, see IoTDA Developer Guide.
Last Article: Platform Overview
Next Article: Quick Device Access

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.