Call an API

Updated at:

This document describes the request structure and provides examples for calling the cloud APIs for IoT Mobile Connection Package.

Request structure

You can call the APIs for IoT Mobile Connection Package by sending an HTTP or HTTPS request.

The request structure is as follows:

http://Endpoint/?Action=xx&Parameters

Parameter

Description

Endpoint

The endpoint for the Alibaba Cloud service. For IoT Mobile Connection Package, the endpoint is https://linkcard.aliyuncs.com/.

Action

The operation to perform, which is the name of the API. For example, to query card traffic information, call the GetCardFlowInfo operation. In this case, set Action to GetCardFlowInfo.

Parameters

The request parameters. Separate each parameter with an ampersand (&).

Request parameters include common parameters and API-specific parameters. Common parameters contain information such as the API version and identity verification details.

The following example shows how to call the GetCardFlowInfo operation to query traffic information for a card:

"http://linkcard.aliyuncs.com/
?AccessKeyId=ACS**********MrZtwL
&Action=GetCardFlowInfo
&Format=JSON
&Iccid=12**************
&SignatureMethod=HMAC-SHA1
&SignatureNonce=ea8cf48************e7c734c7ac3
&SignatureVersion=1.0
&Timestamp=2021-12-23T06%3A42%3A34Z
&Version=2021-05-20
&Signature=QC%2F7HaQl*************dK18U%3D
...
Note

The code example is formatted for readability. For parameter descriptions, see Common parameters and GetCardFlowInfo.

Online API debugging

The Alibaba Cloud OpenAPI Developer Portal provides an online API debugging tool. On the API Debugging page, you can quickly find and test API calls. The system generates SDK code examples in various languages based on your input. These examples appear on the SDK Example tab on the right. The Invocation Result tab shows the actual request URL and the JSON response.

API authorization

For account security, use a Resource Access Management (RAM) user to call APIs. If you use a RAM user to call APIs for IoT Mobile Connection Package, you must create and grant an appropriate authorization policy to that RAM user.