This API operation is used to modify the draft definition of an API. It is different from the ModifyApi operation in that it does not require all information about the API. You need to only specify the parameters that you want to modify. For example, if you want to change the authentication method of the API from Anonymous to APP, you need to only specify the value of AuthType, which is APP.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| apigateway:ModifyApiConfiguration | update | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| ApiId | string | Yes | The ID of the API. | baacc592e63a4cb6a41920d9d3f91f38 |
| ApiName | string | No | The name of the API. | testModifyApiName |
| Description | string | No | The description of the API. | TestModifyDescription |
| Visibility | string | Yes | Specifies whether to make the API public. Valid values:
| PUBLIC |
| ForceNonceCheck | boolean | No |
| true |
| DisableInternet | boolean | No |
| false |
| AppCodeAuthType | string | No | If the AuthType parameter is set to APP, the valid values are:
| DEFAULT |
| AllowSignatureMethod | string | No | If the AuthType parameter is set to APP, you must include this parameter to specify the signature algorithm. If you do not specify a value, HmacSHA256 is used by default. Valid values:
| HmacSHA256 |
| AuthType | string | No | API 安全认证类型,目前可以取值:
| APP |
| RequestProtocol | string | No | The protocol type supported by the API. Valid values: HTTP and HTTPS. Separate multiple values with commas (,), such as "HTTP,HTTPS". | HTTP |
| RequestHttpMethod | string | No | The HTTP method used to make the request. Valid values: GET, POST, DELETE, PUT, HEADER, TRACE, PATCH, CONNECT, and OPTIONS. | GET |
| RequestPath | string | No | The path of the API request. If the complete API URL is | /test/api |
| RequestMode | string | No | The request mode. Valid values:
| MAPPING |
| BodyFormat | string | No | This parameter takes effect only when the RequestMode parameter is set to MAPPING. The format in which data is transmitted to the server for POST and PUT requests. Valid values: FORM and STREAM. FORM indicates that data is transmitted in the key-value pair format. STREAM indicates that data is transmitted as byte streams. | STREAM |
| PostBodyDescription | string | No | The description of the request body. | The description of the request body |
| BodyModel | string | No | The body model. | https://apigateway.aliyun.com/models/f4e7333c****40dcbaf7c9da553ccd8d/3ab61f775b****d4bc35e993****87aa8 |
| ModelName | string | No | The name of the model. | Test |
| BackendName | string | No | The name of the backend service. This parameter takes effect only when the UseBackendService parameter is set to TRUE. | testBackendService |
| ServiceProtocol | string | No | The protocol that is used to access backend services. Valid values:
You must specify the config value for the corresponding backend service. | HTTP |
| HttpConfig | string | No | The HTTP configuration. | {"serviceAddress":"http://test.api.com","servicePath":"/test/api","serviceHttpMethod":"GET"} |
| VpcConfig | string | No | The VPC configuration. | {"VpcId":"vpc-xxxxxxx","Name":"testVpc","InstanceId":"i-p0ssssss","Port":80,"servicePath":"/test/vpc","serviceHttpMethod":"HEAD"} |
| FunctionComputeConfig | string | No | The Function Compute configuration. | {"FcType":"FCEvent","FcRegionId":"cn-hangzhou","RoleArn":"acs:ram::xxxxxxxx:role/aliyunserviceroleforapigateway","selectServiceName":"fcTest","FunctionName":"funcTest","selectFunctionName":"funcTest","Qualifier":"LATEST","Path":"","FcBaseUrl":"","ServiceName":"fcTest"} |
| OssConfig | string | No | The OSS configuration. | {"OssRegionId":"cn-hangzhou","Key":"/test.html","BucketName":"test-api-oss","Action":"GetObject"} |
| MockConfig | string | No | The Mock configuration. | {"MockResult":"test","MockHeaders":[{"HeaderName":"testHeader","HeaderValue":"testHeader"}],"MockStatusCode":"400"} |
| ServiceTimeout | integer | No | The timeout period of the backend service. Unit: milliseconds. | 10000 |
| ContentTypeCategory | string | No | The ContentType configuration of the backend request.
| DEFAULT |
| ContentTypeValue | string | No | The value of the ContentType header when the ServiceProtocol parameter is set to HTTP and the ContentTypeCatagory parameter is set to DEFAULT or CUSTOM. | application/x-www-form-urlencoded; charset=UTF-8 |
| RequestParameters | string | No | The parameters of API requests sent by the consumer to API Gateway. For more information, see RequestParameter . | [{"ParameterLocation":{"name":"Head","orderNumber":2},"ParameterType":"String","Required":"OPTIONAL","isHide":false,"ApiParameterName":"header1","DefaultValue":"123124","Location":"Head"},{"ParameterLocation":{"name":"Head","orderNumber":2},"ParameterType":"String","Required":"REQUIRED","isHide":false,"ApiParameterName":"header2","DefaultValue":"","Location":"Head"},{"ParameterLocation":{"name":"Query","orderNumber":3},"ParameterType":"String","Required":"OPTIONAL","isHide":false,"ApiParameterName":"query1","DefaultValue":"1245","Location":"Query"},{"ApiParameterName":"CaClientIp","ParameterLocation":{"name":"Query","orderNumber":0},"Location":"Query","ParameterType":"String","Required":"REQUIRED","Description":"ClientIP"},{"ApiParameterName":"testConstant","ParameterLocation":{"name":"Head","orderNumber":0},"Location":"Head","ParameterType":"String","Required":"REQUIRED","DefaultValue":"111"}] |
| ServiceParameters | string | No | The parameters of API requests sent by API Gateway to the backend service. For more information, see ServiceParameter . | [{"ServiceParameterName":"header1","Location":"Head","Type":"String","ParameterCatalog":"REQUEST"},{"ServiceParameterName":"header2","Location":"Query","Type":"String","ParameterCatalog":"REQUEST"},{"ServiceParameterName":"query1","Location":"Head","Type":"String","ParameterCatalog":"REQUEST"},{"ServiceParameterName":"ipp","Location":"Query","Type":"String","ParameterCatalog":"SYSTEM"},{"ServiceParameterName":"testConstant","Location":"Head","Type":"String","ParameterCatalog":"CONSTANT"}] |
| ServiceParametersMap | string | No | The mappings between parameters of requests sent by the consumer to API Gateway and parameters of requests sent by API Gateway to the backend service. For more information, see ServiceParameterMap . | [{"ServiceParameterName":"header1","RequestParameterName":"header1"},{"ServiceParameterName":"header2","RequestParameterName":"header2"},{"ServiceParameterName":"query1","RequestParameterName":"query1"},{"ServiceParameterName":"ipp","RequestParameterName":"CaClientIp"},{"ServiceParameterName":"testConstant","RequestParameterName":"testConstant"}] |
| ResultType | string | No | The format of the response from the backend service. Valid values: JSON, TEXT, BINARY, XML, and HTML. This value is used only to generate documents. It does not affect the returned result. | JSON |
| ResultSample | string | No | The sample response from the backend service. This value is used only to generate documents. It does not affect the returned result. | {\n \"status\": 0,\n \"data\": {\n \"count\": 1,\n \"list\": [\n \"352\"\n ]\n },\n \"message\": \"success\"\n} |
| FailResultSample | string | No | The sample error response from the backend service. This value is used only to generate documents. It does not affect the returned result. | {"errorCode":"fail","errorMessage":"param invalid"} |
| ErrorCodeSamples | string | No | The sample error codes returned by the backend service. For more information, see ErrorCodeSample . | [{"Code":"400","Message":"Missing the userId","Description":"param invalid"}] |
| UseBackendService | boolean | No | Specifies whether to use the information about the created backend service. Valid values:
| TRUE |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "6C87A26A-6A18-4B8E-8099-705278381A2C"
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|
