You can call APIs opened by others in APIG.
An API can be accessed 1,000 times by using the debugging domain name allocated when the API's group is created.
Obtain API calling information from the API provider before you call an API.
On the APIG console, choose API Publishing > APIs. Click an API name to view the domain name, request method, request path, and basic information of the API.
Obtain the request authentication information according to the API's authentication mode.
Authentication Mode | Authentication Information |
|---|---|
App (signature) | Obtain the AppKey and AppSecret of the app authorized for the API from the API provider, as well as the signing SDK. |
App (simple authentication) | Obtain the AppCode of the app authorized for the API from the API provider. |
IAM (token) | Obtain the username and password for the cloud platform. |
IAM (AK/SK) | Obtain the AK/SK of an account for the cloud platform and the signing SDK. |
Custom | Obtain the custom authentication information to carry in request parameters from the API provider. |
None | No authentication information required. |
On the shared gateway console, choose API Calling > Apps. In the app list, click the name of the app that the API is authorized to access. On the app details page that is displayed, obtain the AppKey and AppSecret of the app.
On the shared gateway console, choose Help Center > SDK Process Flow, and download the SDK of the desired language.
On the shared gateway console, choose API Calling > Apps. In the app list, click the name of the app that the API is authorized to access. On the app details page that is displayed, obtain the AppCode on the AppCodes tab page.
This section describes only the configuration of the request path and authentication parameters. For other parameters, such as timeout and SSL, configure them as required. To avoid service loss due to incorrect parameters, configure them by referring to the industry standards.
POST https:// {Address} / {Path} ? {Query}{Header}{{Body}}
Scenario | Request Parameter Configuration |
|---|---|
Calling an API with a domain name | Call an API using the debugging domain name allocated to the API group or a domain name bound to the group. No additional configuration is required. |
Calling an API with an IP address | To use an IP address to call an API, add the header parameter host. |
Authentication Mode | Request Parameter Configuration |
|---|---|
App (signature) | Use the obtained SDK to sign the API request. For details, see section "Calling APIs Through App Authentication" in the API Gateway Developer Guide. |
App (simple authentication) | Add the header parameter X-Apig-AppCode and set the parameter value to the AppCode obtained in Obtaining API Calling Information. For details, see Getting Started. |
IAM (token) | Obtain a token from the cloud platform and add the header parameter X-Auth-Token with the token as the value. For details, see section "Token Authentication" in the API Gateway Developer Guide. |
IAM (AK/SK) | Use the obtained SDK to sign the API request. For details, see section "AK/SK Authentication" in the API Gateway Developer Guide. |
Custom | Add the information required for custom authentication to the API request. |
None | Call APIs without authentication. |