Invoke APIs
This topic describes the request structure and provides an example for invoking the cloud APIs of IoT Edge.
Request structure
You can invoke the cloud APIs of IoT Edge by sending an HTTP or HTTPS request.
The request structure is as follows:
http://Endpoint/?Action=****&Parameters| Parameter | Description |
| Endpoint | The endpoint of the Alibaba Cloud service. IoT Edge uses two endpoint formats:
|
| Action | The operation to perform, which is the name of the cloud API. For example, to get the status of a unified search-by-image job, call the GetPictureSearchJobStatus operation. In this case, set the Action parameter to GetPictureSearchJobStatus. |
| Parameters | The request parameters for the API call. Each parameter is separated by an ampersand (&). Request parameters consist of common request parameters and API-specific request parameters. Common parameters include information such as the API version and identity verification. |
The following example shows how to call the GetPictureSearchJobStatus operation to retrieve the status of a unified search-by-image job:
http(s)://linkvisual.cn-shanghai.aliyuncs.com/?Action=GetPictureSearchJobStatus
&Format=xml
&Version=2018-01-20
&Signature=Pc5WB8gok***1dgI%3D
&SignatureMethod=HMAC-SHA1
&SignatureNonce=15215528852396
&SignatureVersion=1.0
&AccessKeyId=testid
&TimeStamp=2019-06-01T12:00:00Z
&RegionId=cn-shanghai
…API online debugging
The Alibaba Cloud OpenAPI Developer Portal provides an API debugging tool. On the API Debugging page, you can quickly search for and test API calls. The system automatically generates sample code for different SDKs based on your input parameters. This sample code is displayed on the SDK Example tab on the right. On the Call Result tab, you can view the response in JSON format.

API authorization
To ensure your account security, use a Resource Access Management (RAM) user to invoke APIs. If you use a RAM user to invoke IoT Edge APIs, you must create and attach an authorization policy to that RAM user.
For more information, see the IoT API authorization mapping table.