This topic describes the syntax of IoT Platform API requests and provides a sample request.

Request syntax

You can send HTTP or HTTPS requests to IoT Platform.

Request syntax:

http://Endpoint/?Action=****&Parameters
ParameterDescription
EndpointThe endpoint of IoT Platform. Format: iot.${RegionId}.aliyuncs.com. Replace ${RegionId} with the ID of the region where you activated IoT Platform. For more information about Alibaba Cloud region IDs, see Supported regions.
ActionThe name of the API operation that you want to perform. For example, to publish a message to a specified topic, specify Action=Pub.
ParametersThe request parameters of the API operation. Separate multiple parameters with ampersands (&).

Request parameters include common request parameters and operation-specific parameters.Common parameters Common parameters specify the API version number and the authentication information.

Sample request

Alibaba Cloud provides the IoT Platform API version . In this example, the Pub operation of the version 2018-01-20 is called to publish messages to a topic.
Note In this example, an IoT Platform endpoint of the China (Shanghai) region is used. The code is formatted for ease of reading. For more information about request parameters, see Common parameters and Pub.
https://iot.cn-shanghai.aliyuncs.com/?Action=Pub
&Format=XML
&Version=2018-01-20
&Signature=Pc5WB8gok***1dgI%3D
&SignatureMethod=HMAC-SHA1
&SignatureNonce=15215528852396
&SignatureVersion=1.0
&AccessKeyId=LTAI4***iW5j3
&Timestamp=2017-07-19T12:00:00Z
&RegionId=cn-shanghai
...

Debugging

Alibaba Cloud OpenAPI Explorer provides online debugging tools for API operations. On the API Debugging page, you can search for API operations and call API operations. OpenAPI Explorer dynamically generates the sample code of API operations for different SDKs. On the right side of the page, you can view the sample code of an SDK on the Example Code tab. On the Debugging Result tab, you can view the actual request URL and the response in the JSON format.

OpenAPI