Updated on 2024-11-04 GMT+08:00

API Usage Guide

The IoT platform provides a variety of APIs to make application development easier and more efficient. You can call these open APIs to quickly integrate platform functions, such as management of products, devices, subscriptions, commands, and rules.

The application needs to be authenticated by the IAM service. To obtain a token, see Debugging the API Obtaining the Token for an IAM User.

Application Development Resources

The platform provides a wealth of application-side APIs to ease application development. Applications can call these APIs to implement services such as secure access, device management, data collection, and command delivery.

Resource Package

Description

Download Link

Application API Java Demo

You can call application-side APIs to experience service functions and service processes.

API Java Demo

Application Java SDK

You can use Java methods to call application-side APIs to communicate with the platform. For details, see Java SDK.

Java SDK

Application .NET SDK

You can use .NET methods to call application-side APIs to communicate with the platform. For details, see .NET SDK.

.Net SDK

Application Python SDK

You can use Python methods to call application-side APIs to communicate with the platform. For details, see Python SDK.

Python SDK

Application Go SDK

You can use Go methods to call application-side APIs to communicate with the platform. For details, see Go SDK.

Go SDK

Application Node.js SDK

You can use Node.js methods to call application-side APIs to communicate with the platform. For details, see Node.js SDK.

Node.js SDK

Application PHP SDK

You can use PHP methods to call application-side APIs to communicate with the platform. For details, see PHP SDK.

PHP SDK

API Introduction

API Group

Scenario

Product management

Used to manage product models that have been imported to the platform. A product model defines the capabilities or features of all devices under a product.

Device management

Used by applications to manage devices, including basic device details and device data.

Device message

Used by applications to transparently transmit messages to devices.

Device command

Used by applications to deliver commands to devices for control. A product model defines commands that the platform can deliver to devices.

Device property

Used by applications to deliver properties to devices. A product model defines properties that the platform can deliver to devices.

AMQP queue management

Used to create, delete, and view queues. AMQP queues can receive messages through AMQP clients after subscribing to rules.

Access credential management

Used for authentication when long connections are established using protocols such as AMQP and MQTTS.

Data transfer rule management APIs and device linkage rule APIs

Used by applications to set rules to implement service linkage or forward data to other Huawei Cloud services. Device linkage and data forwarding rules are available.

  • A device linkage rule consists of triggers and actions. When the configured trigger is met, the corresponding action is triggered, for example, delivering commands, sending notifications, reporting alarms, and clearing alarms.
  • For a data forwarding rule, you need to set forwarding data, set forwarding targets, and start the rule. Data can be forwarded to Data Ingestion Service (DIS), Distributed Message Service (DMS) for Kafka, Object Storage Service (OBS), ROMA Connect, third-party application (HTTP push), , , , and AMQP message queue.

Subscription management APIs

Used by applications to subscribe to resources provided by the platform. If the subscribed resources change, the platform notifies the applications of the change.

Device shadow APIs

Used by applications to operate and manage the device shadow. A device shadow is a file used to store and retrieve the status of a device.

  • Each device has only one device shadow, which is uniquely identified by the device ID.
  • The device shadow saves only the latest data reported by the device and the desired data set by an application.
  • You can use the device shadow to query and set the device status regardless of whether the device is online.

Device group management APIs

Used by applications to manage device groups, including group details and device members in a group.

Tag management APIs

Used by applications to bind tags to or unbind tags from resources.

Currently, only devices support tags.

Resource space management

Used by applications to manage resource spaces, including adding, deleting, modifying, and querying resource spaces.

Batch task APIs

Used by applications to perform batch operations on devices connected to the platform.

  • Supported batch operations: upgrading software and firmware, creating, deleting, updating, freezing, and unfreezing devices, creating synchronous and asynchronous commands, creating messages, and setting device shadow.
  • Up to 10 unfinished tasks of the same type is allowed for a user. When the maximum number is reached, new tasks cannot be created.

Device CA certificate management APIs

Used by applications to manage device CA certificates, including uploading, verifying, and querying certificates. The platform supports device access authentication using certificates.

OTA upgrade package management

Used by applications to operate and manage upgrade packages, including creating, querying, and deleting upgrade packages.

Broadcast message

Used by applications to broadcast messages to all online devices that subscribe to specified topics.

Device tunnel management

Used for data transmission between applications and devices.

Data stack policy management

Used by applications to manage stack policies, including creating, querying, modifying, and deleting stack policies.

Data flow control policy management

Used by applications to manage flow control policies, including creating, querying, modifying, and deleting flow control policies.