Alibaba Cloud provides a wide range of API operations that allow you to access and manage cloud resources by means of programming. Correctly understanding and using the API metadata is critical when you use these API operations, especially in self-signed mode. This topic describes how to obtain the information required for calling API operations in self-signed mode.
Metadata overview
API metadata is a collection of all descriptive information related to Alibaba Cloud API operations. Before you call an API operation in self-signed mode, you must obtain the following information about the specific cloud service and API operation: API style, protocol, request method, parameter names, parameter types, and parameter locations.
Service and version information
The information includes the API style, service code, and API version.
Example:
{"style":"RPC","product":"Ecs","version":"2014-05-26"}
API summary
The Map structure is used to display the API operation name as the key and the API summary as the value. The API summary contains the following parameters.
Parameter | Description | Example |
methods | The request methods that are supported by the API operation. |
This example indicates that the API operation supports both the POST and GET request methods. The two methods have no difference in the call results. |
schemes | The protocols that are supported by the API operation. |
This example indicates that the API operation supports both HTTP and HTTPS. |
parameters | The request parameters. |
The parameter information includes the parameter name, location (query, path, and body), parameter type, and whether the parameter is required. |
Endpoints
The endpoints of the cloud service.
Obtain API metadata
Method 1: Obtain the metadata of a cloud service
Visit OpenAPI Portal and select a cloud service. In this example, Elastic Compute Service is selected. Click Metadata below Elastic Compute Service.
Method 2: Obtain the metadata of an API operation
Visit OpenAPI Portal and select a cloud service. In this example, Elastic Compute Service is selected. Select the API operation that you want to call and click Metadata in the upper-right corner of the page.
Method 3: Call a metadata API operation to obtain the metadata
You can call a metadata API operation over the Internet without the need for authentication. The following table describes how to obtain the metadata. For more information about metadata API operations, see Guidelines for use.
Operation | API URL | Request method |
Query the service codes and API versions of all cloud services | https://api.aliyun.com/meta/v1/products.json?language=EN_US | GET |
Query the metadata of the specified version of the specified service | https://api.aliyun.com/meta/v1/products/{product}/versions/{version}/api-docs.json | GET |
Query the metadata of the specified API operation | https://api.aliyun.com/meta/v1/products/{product}/versions/{version}/apis/{api_name}/api.json | GET |