DescribeApiHistory
Queries the definition details of a specific historical release version of a specified API.
Operation description
Queries the definition details of a specific historical release version of a specified API, which is the API definition published during that historical release.
This feature is intended for users of open APIs.
The gateway records the release time and definition of each API release. You can obtain the version number through other API operations to query the definition details of a specific release.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
apigateway:DescribeApiHistory |
get |
*ApiGroup
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| GroupId |
string |
No |
The ID of the API group. The ID is generated by the system and is globally unique. |
3013a55c0c44483f984d26df27120513 |
| ApiId |
string |
Yes |
The ID of the API. |
dc6e17ee3120404c839bbcd7622ab6ed |
| StageName |
string |
Yes |
The name of the environment. Valid values:
|
RELEASE |
| HistoryVersion |
string |
Yes |
The historical version number. |
20211122155403834 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Status |
string |
The API call status. |
200 |
| ApiId |
string |
The API ID. |
bebf996e4b3d445d83078094b72b0d91 |
| ResultType |
string |
The data type of the response. |
JSON |
| WebSocketApiType |
string |
The type of the two-way communication API. Valid values:
|
COMMON |
| DisableInternet |
boolean |
|
true |
| ResultBodyModel |
string |
The response body model of the API. |
{} |
| ResultSample |
string |
The response example. |
{\n \"status\": 0,\n \"data\": {\n \"count\": 1,\n \"list\": [\n \"352\"\n ]\n },\n \"message\": \"success\"\n} |
| AppCodeAuthType |
string |
The authentication type that supports AppCode. Valid values:
|
HEADER |
| AllowSignatureMethod |
string |
The signature algorithm used when AuthType is set to APP. If this parameter is not specified, HmacSHA256 is used by default. Valid values:
|
HmacSHA256 |
| RegionId |
string |
The region ID. |
cn-hangzhou |
| ForceNonceCheck |
boolean |
|
true |
| Visibility |
string |
Specifies whether the API is public. Valid values:
|
PUBLIC |
| FailResultSample |
string |
The example of the response returned when the backend service fails. |
{"errorCode":"fail","errorMessage":"param invalid"} |
| AuthType |
string |
The security authentication type of the API. Valid values:
|
APP |
| RequestId |
string |
The ID of the request. |
6C87A26A-6A18-4B8E-8099-705278381A2C |
| Description |
string |
The description of the API. |
Query the weather based on the region name |
| GroupName |
string |
The name of the API group. |
dev_api |
| GroupId |
string |
The ID of the API group. |
cfb6ef799bf54fffabb0f02019ad2581 |
| DeployedTime |
string |
The deployment time in UTC. |
2021-06-1113:57:38 |
| StageName |
string |
The environment where the API is deployed. Valid values:
|
RELEASE |
| HistoryVersion |
string |
The historical version number. |
20211022134156663 |
| ApiName |
string |
The name of the API. |
Test API |
| BackendEnable |
boolean |
Specifies whether the backend service is enabled. |
true |
| BackendConfig |
object |
The backend configuration. |
|
| BackendId |
string |
The ID of the backend service. |
a0305308908c4740aba9cbfd63ba99b7 |
| BackendType |
string |
The type of the backend service. |
HTTP |
| BackendName |
string |
The service name of the backend. |
zmapi |
| RequestConfig |
object |
The configuration items for API requests sent from the consumer to the gateway. For more information, see RequestConfig. |
|
| BodyModel |
string |
The body model. |
https://apigateway.aliyun.com/models/340a127dcc4afd9ab1bf7e947b4095/9e2df550e85b412179ec33e2619eaab |
| RequestPath |
string |
API path |
/api/billing/test/[type] |
| RequestHttpMethod |
string |
The HTTP method. Valid values: GET, POST, DELETE, PUT, HEADER, TRACE, PATCH, CONNECT, and OPTIONS. |
POST |
| BodyFormat |
string |
The format in which data is passed to the server for POST or PUT requests. Valid values: FORM and STREAM. FORM indicates the form format (key-value pairs), and STREAM indicates the byte stream format. This parameter is valid only when RequestMode is set to MAPPING. |
STREAM |
| RequestMode |
string |
The request mode for input parameters. Valid values:
|
MAPPING |
| PostBodyDescription |
string |
The description of the request body. |
fwefwef |
| RequestProtocol |
string |
The protocol types supported by the API. You can specify multiple protocols and separate them with commas (,), such as "HTTP,HTTPS". Valid values: HTTP and HTTPS. |
HTTP |
| EscapePathParam |
boolean |
Specifies whether to escape square brackets ([]) in the path. |
false |
| ServiceConfig |
object |
The information items to invoke the backend service. |
|
| VpcId |
string |
The ID of the VPC. |
vpc-uf6kg9x8sx2tbxxxx |
| MockStatusCode |
integer |
The HTTP status code returned in mock mode. |
200 |
| ContentTypeValue |
string |
The value of the Content-Type header when the backend service is an HTTP service and ContentTypeCatagory is set to DEFAULT or CUSTOM. |
application/json |
| ServiceProtocol |
string |
The protocol type of the backend service. Valid values: HTTP, HTTPS, and FunctionCompute. |
HTTP |
| ServicePath |
string |
The path used to call the backend service. |
/object/add |
| ContentTypeCatagory |
string |
The policy for the value of the Content-Type header when the backend service is an HTTP service. Valid values:
|
CUSTOM |
| ServiceAddress |
string |
The address used to call the backend service. |
http://api.a.com:8080 |
| Mock |
string |
Specifies whether to enable mock mode. Valid values:
|
TRUE |
| ServiceVpcEnable |
string |
Specifies whether to enable the VPC channel. Valid values:
|
TRUE |
| MockResult |
string |
The result returned when mock mode is enabled. |
test result |
| ServiceHttpMethod |
string |
The HTTP method used to call the backend service. Valid values: PUT, GET, POST, DELETE, PATCH, HEAD, OPTIONS, and ANY. |
POST |
| ServiceTimeout |
integer |
The timeout period for the backend service. Unit: milliseconds. |
1000 |
| MockHeaders |
object |
||
| MockHeader |
array<object> |
The mock headers. |
|
|
object |
|||
| HeaderValue |
string |
The value of the HTTP header. |
86400 |
| HeaderName |
string |
The name of the HTTP header. |
Content-Type |
| VpcConfig |
object |
The configuration items of the VPC channel. |
|
| VpcId |
string |
The ID of the VPC. |
vpc-2zeafsc3fygk1*** |
| VpcScheme |
string |
The VPC scheme. |
HTTP |
| InstanceId |
string |
The instance ID (ECS or load balancing) in the VPC. |
i-bp1h497hkijewv2*** |
| Port |
integer |
The port number of the instance. |
8080 |
| Name |
string |
The name of the VPC. |
glmall-app-test |
| FunctionComputeConfig |
object |
The backend configuration items when the backend service is Function Compute. |
|
| FcType |
string |
The type of the Function Compute service. |
HttpTrigger |
| RoleArn |
string |
The ARN of the RAM role that authorizes API Gateway to access Function Compute. |
acs:ram::111***:role/aliyunserviceroleforsas |
| Method |
string |
The request method. |
GET |
| FcBaseUrl |
string |
The base URL of the Function Compute service. |
https://122xxxxxxx.fc.aliyun.com/2016xxxx/proxy/testSxxx.xxx/testHttp/ |
| ContentTypeValue |
string |
The value of the Content-Type header when the backend service is an HTTP service and ContentTypeCatagory is set to DEFAULT or CUSTOM. |
application/json |
| RegionId |
string |
The region ID. |
cn-hangzhou |
| OnlyBusinessPath |
boolean |
Specifies whether the backend service receives only the business path. |
false |
| FunctionName |
string |
The name of the function defined in Function Compute. |
domain_business_control |
| ContentTypeCatagory |
string |
The policy for the value of the Content-Type header when the backend service is an HTTP service. Valid values:
|
DEFAULT |
| Path |
string |
The API request path. |
/api/offline/cacheData |
| ServiceName |
string |
The name of the service defined in Function Compute. |
fcservicename |
| Qualifier |
string |
The alias of the function. |
2 |
| OssConfig |
object |
The configuration information when the backend service is OSS. |
|
| Key |
string |
The path of the object or folder stored in OSS. |
/folder/test.json |
| Action |
string |
The OSS operation. Valid values:
|
GetObject |
| OssRegionId |
string |
The region ID of the OSS service. |
cn-hangzhou |
| BucketName |
string |
The name of the OSS bucket. |
phototest02 |
| EventBridgeConfig |
object |
The EventBridge configuration. |
|
| EventBridgeRegionId |
string |
The region ID of the EventBridge service. |
cn-beijing |
| EventBus |
string |
The event bus. |
testBus |
| EventSource |
string |
The event source. |
baas_driver |
| RoleArn |
string |
The ARN of the RAM role authorized for EventBridge. |
acs:ram::1933122015759***:role/adminoidcaliyun |
| OpenIdConnectConfig |
object |
The OpenID Connect configuration items for third-party account authentication. |
|
| OpenIdApiType |
string |
The OpenID Connect mode. Valid values:
|
IDTOKEN |
| IdTokenParamName |
string |
The name of the parameter that corresponds to the token. |
id_token |
| PublicKeyId |
string |
The ID of the public key. |
88483727556929326703309904351185815489 |
| PublicKey |
string |
The public key of the API. |
EB1837F8693CCED0BF750B3AD48467BEB569E780A14591CF92 |
| ErrorCodeSamples |
object |
||
| ErrorCodeSample |
array<object> |
The sample error codes returned by the backend service. For more information, see ErrorCodeSample. |
|
|
object |
|||
| Code |
string |
The error code. |
400 |
| Message |
string |
The error message. |
MissingParameter |
| Description |
string |
The description. |
Missing the parameter UserId |
| ResultDescriptions |
object |
||
| ResultDescription |
array<object> |
The return description of the API. |
|
|
object |
|||
| Type |
string |
The result type. |
String |
| Key |
string |
The primary key of the result. |
groupName |
| HasChild |
boolean |
Indicates whether the result has child nodes. |
true |
| Description |
string |
The description. |
for_test1 |
| Pid |
string |
The ID of the parent node. |
pid |
| Mandatory |
boolean |
Indicates whether the field is required. |
true |
| Name |
string |
The name of the result. |
fwqf |
| Id |
string |
The ID of the result. |
id |
| SystemParameters |
object |
||
| SystemParameter |
array<object> |
The common parameters of the API in JSON format. |
|
|
object |
|||
| DemoValue |
string |
The sample value. |
192.168.1.1 |
| Description |
string |
The description. |
system parameters description |
| ParameterName |
string |
The name of the system parameter. Valid values: CaClientIp, CaDomain, CaRequestHandleTime, CaAppId, CaRequestId, CaHttpSchema, and CaProxy. |
CaClientIp |
| Location |
string |
The location of the parameter. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameterName |
string |
The name of the corresponding backend parameter. |
clientIp |
| CustomSystemParameters |
object |
||
| CustomSystemParameter |
array<object> |
The list of custom system parameters. |
|
|
object |
|||
| DemoValue |
string |
The sample value. |
192.168.1.1 |
| Description |
string |
The description of the custom system parameter. |
balabala |
| ParameterName |
string |
The name of the custom system parameter. |
CaClientIp |
| Location |
string |
The location of the parameter. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameterName |
string |
The name of the corresponding backend parameter. |
clientIp |
| ConstantParameters |
object |
||
| ConstantParameter |
array<object> |
The list of constant parameters. |
|
|
object |
|||
| Description |
string |
The description. |
for_test1 |
| Location |
string |
The location of the parameter. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameterName |
string |
The name of the backend parameter. |
constance |
| ConstantValue |
string |
The constant value. |
constance |
| RequestParameters |
object |
||
| RequestParameter |
array<object> |
The description of the parameters that the consumer sends to the API gateway in an API request. For more information, see RequestParameter. |
|
|
object |
|||
| JsonScheme |
string |
JSON scheme |
{} |
| MaxValue |
integer |
The maximum value of the parameter. This parameter takes effect only when ParameterType is set to Int, Long, Float, or Double. |
123456 |
| ArrayItemsType |
string |
The type of the array element. |
String |
| MinValue |
integer |
The minimum value of the parameter. This parameter takes effect only when ParameterType is set to Int, Long, Float, or Double. |
123456 |
| DocShow |
string |
The visibility of the parameter in the document. Valid values: PUBLIC and PRIVATE. |
PUBLIC |
| MaxLength |
integer |
The maximum length of the parameter. This parameter takes effect only when ParameterType is set to String. |
123456 |
| DefaultValue |
string |
The default value. |
20 |
| ApiParameterName |
string |
The name of the API parameter. |
age |
| EnumValue |
string |
The allowed enumeration values of the parameter. This parameter takes effect only when ParameterType is set to Int, Long, Float, Double, or String. Separate multiple values with commas (,), such as 1,2,3,4,9 or A,B,C,E,F. |
boy,girl |
| DemoValue |
string |
The sample value. |
20 |
| Required |
string |
Indicates whether the parameter is required. Valid values: REQUIRED and OPTIONAL. |
OPTIONAL |
| Description |
string |
The description. |
modidyTest |
| ParameterType |
string |
The parameter type. Valid values: String, Int, Long, Float, Double, and Boolean, which represent string, integer, long integer, single-precision floating-point number, double-precision floating-point number, and Boolean, respectively. |
String |
| RegularExpression |
string |
The regular expression used to validate the parameter. This parameter takes effect only when ParameterType is set to String. |
^[a-zA-Z0-9]+$ |
| MinLength |
integer |
The minimum length of the parameter. This parameter takes effect only when ParameterType is set to String. |
123456 |
| DocOrder |
integer |
The order of the parameter in the document. |
0 |
| Location |
string |
The location of the parameter. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameters |
object |
||
| ServiceParameter |
array<object> |
The description of the parameters that the API gateway sends to the backend service in an API request. For more information, see ServiceParameter. |
|
|
object |
|||
| Location |
string |
The location of the parameter. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ParameterType |
string |
The data type of the backend parameter. Valid values: STRING, NUMBER, and BOOLEAN. |
String |
| ServiceParameterName |
string |
The name of the backend parameter. |
clientIp |
| ServiceParametersMap |
object |
||
| ServiceParameterMap |
array<object> |
The mapping between the parameters that the consumer sends to the API gateway and the parameters that the API gateway sends to the backend service. For more information, see ServiceParameterMap. |
|
|
object |
|||
| RequestParameterName |
string |
The name of the corresponding frontend request parameter. The value must exist in RequestParametersObject and match RequestParam.ApiParameterName. |
sex |
| ServiceParameterName |
string |
The name of the backend parameter. |
sex |
Examples
Success response
JSON format
{
"Status": "200",
"ApiId": "bebf996e4b3d445d83078094b72b0d91",
"ResultType": "JSON",
"WebSocketApiType": "COMMON",
"DisableInternet": true,
"ResultBodyModel": "{}",
"ResultSample": "{\\n \\\"status\\\": 0,\\n \\\"data\\\": {\\n \\\"count\\\": 1,\\n \\\"list\\\": [\\n \\\"352\\\"\\n ]\\n },\\n \\\"message\\\": \\\"success\\\"\\n}",
"AppCodeAuthType": "HEADER",
"AllowSignatureMethod": "HmacSHA256",
"RegionId": "cn-hangzhou",
"ForceNonceCheck": true,
"Visibility": "PUBLIC",
"FailResultSample": "{\"errorCode\":\"fail\",\"errorMessage\":\"param invalid\"}",
"AuthType": "APP",
"RequestId": "6C87A26A-6A18-4B8E-8099-705278381A2C",
"Description": "Query weather by region name",
"GroupName": "dev_api",
"GroupId": "cfb6ef799bf54fffabb0f02019ad2581",
"DeployedTime": "2021-06-1113:57:38",
"StageName": "RELEASE",
"HistoryVersion": "20211022134156663",
"ApiName": "Test API",
"BackendEnable": true,
"BackendConfig": {
"BackendId": "a0305308908c4740aba9cbfd63ba99b7",
"BackendType": "HTTP",
"BackendName": "zmapi"
},
"RequestConfig": {
"BodyModel": "https://apigateway.aliyun.com/models/340a127dcc4afd9ab1bf7e947b4095/9e2df550e85b412179ec33e2619eaab",
"RequestPath": "/api/billing/test/[type]",
"RequestHttpMethod": "POST",
"BodyFormat": "STREAM",
"RequestMode": "MAPPING",
"PostBodyDescription": "fwefwef",
"RequestProtocol": "HTTP",
"EscapePathParam": false
},
"ServiceConfig": {
"VpcId": "vpc-uf6kg9x8sx2tbxxxx",
"MockStatusCode": 200,
"ContentTypeValue": "application/json",
"ServiceProtocol": "HTTP",
"ServicePath": "/object/add",
"ContentTypeCatagory": "CUSTOM",
"ServiceAddress": "http://api.a.com:8080",
"Mock": "TRUE",
"ServiceVpcEnable": "TRUE",
"MockResult": "test result",
"ServiceHttpMethod": "POST",
"ServiceTimeout": 1000,
"MockHeaders": {
"MockHeader": [
{
"HeaderValue": "86400",
"HeaderName": "Content-Type"
}
]
},
"VpcConfig": {
"VpcId": "vpc-2zeafsc3fygk1***",
"VpcScheme": "HTTP",
"InstanceId": "i-bp1h497hkijewv2***",
"Port": 8080,
"Name": "glmall-app-test"
},
"FunctionComputeConfig": {
"FcType": "HttpTrigger",
"RoleArn": "acs:ram::111***:role/aliyunserviceroleforsas",
"Method": "GET",
"FcBaseUrl": "https://122xxxxxxx.fc.aliyun.com/2016xxxx/proxy/testSxxx.xxx/testHttp/",
"ContentTypeValue": "application/json",
"RegionId": "cn-hangzhou",
"OnlyBusinessPath": false,
"FunctionName": "domain_business_control",
"ContentTypeCatagory": "DEFAULT",
"Path": "/api/offline/cacheData",
"ServiceName": "fcservicename",
"Qualifier": "2"
},
"OssConfig": {
"Key": "/folder/test.json",
"Action": "GetObject",
"OssRegionId": "cn-hangzhou",
"BucketName": "phototest02"
},
"EventBridgeConfig": {
"EventBridgeRegionId": "cn-beijing",
"EventBus": "testBus",
"EventSource": "baas_driver",
"RoleArn": "acs:ram::1933122015759***:role/adminoidcaliyun"
}
},
"OpenIdConnectConfig": {
"OpenIdApiType": "IDTOKEN",
"IdTokenParamName": "id_token",
"PublicKeyId": "88483727556929326703309904351185815489",
"PublicKey": "EB1837F8693CCED0BF750B3AD48467BEB569E780A14591CF92"
},
"ErrorCodeSamples": {
"ErrorCodeSample": [
{
"Code": "400",
"Message": "MissingParameter",
"Description": "Missing the parameter UserId"
}
]
},
"ResultDescriptions": {
"ResultDescription": [
{
"Type": "String",
"Key": "groupName",
"HasChild": true,
"Description": "for_test1",
"Pid": "pid",
"Mandatory": true,
"Name": "fwqf",
"Id": "id"
}
]
},
"SystemParameters": {
"SystemParameter": [
{
"DemoValue": "192.168.1.1",
"Description": "system parameters description",
"ParameterName": "CaClientIp",
"Location": "HEAD",
"ServiceParameterName": "clientIp"
}
]
},
"CustomSystemParameters": {
"CustomSystemParameter": [
{
"DemoValue": "192.168.1.1",
"Description": "balabala",
"ParameterName": "CaClientIp",
"Location": "HEAD",
"ServiceParameterName": "clientIp"
}
]
},
"ConstantParameters": {
"ConstantParameter": [
{
"Description": "for_test1",
"Location": "HEAD",
"ServiceParameterName": "constance",
"ConstantValue": "constance"
}
]
},
"RequestParameters": {
"RequestParameter": [
{
"JsonScheme": "{}",
"MaxValue": 123456,
"ArrayItemsType": "String",
"MinValue": 123456,
"DocShow": "PUBLIC",
"MaxLength": 123456,
"DefaultValue": "20",
"ApiParameterName": "age",
"EnumValue": "boy,girl",
"DemoValue": "20",
"Required": "OPTIONAL",
"Description": "modidyTest",
"ParameterType": "String",
"RegularExpression": "^[a-zA-Z0-9]+$",
"MinLength": 123456,
"DocOrder": 0,
"Location": "HEAD"
}
]
},
"ServiceParameters": {
"ServiceParameter": [
{
"Location": "HEAD",
"ParameterType": "String",
"ServiceParameterName": "clientIp"
}
]
},
"ServiceParametersMap": {
"ServiceParameterMap": [
{
"RequestParameterName": "sex",
"ServiceParameterName": "sex"
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.