ModifyApi

Updated at:

Modifies the definition of an API.

Operation description

" This operation is intended for users of open APIs.

  • This operation requires a full update and does not support partial parameter updates.

  • When modifying ApiName, note that API names must be unique within the same group.

  • When modifying RequestPath, note that paths must be unique within the same group.

  • The QPS limit for this operation is 50 per user.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

apigateway:ModifyApi

update

*ApiGroup

acs:apigateway:{#regionId}:{#accountId}:apigroup/{#GroupId}

None None

Request parameters

Parameter

Type

Required

Description

Example

GroupId

string

No

The specified group ID.

927d50c0f2e54b359919923d908bb015

ApiId

string

Yes

The API ID.

8afff6c8c4c6447abb035812e4d66b65

ApiName

string

Yes

The name of the API. The name must be unique within the group. The name can contain Chinese characters, letters, digits, and underscores, and must start with a letter or a Chinese character. The name must be 4 to 50 characters in length.

ApiName

Description

string

No

The description of the API. The description can be up to 180 characters in length.

Api description

Visibility

string

Yes

Specifies whether the API is public. Valid values:

  • PUBLIC: Public. If you select this value, the API in the production environment is displayed on the Discover APIs page in the console of all users.

  • PRIVATE: Private. If you select this value and the group to which the API belongs is listed in Alibaba Cloud Marketplace, the private API is not listed.

PUBLIC

AuthType

string

No

The security authentication type of the API. Valid values:

  • APP: Only authorized applications are allowed to call the API.

  • ANONYMOUS: Anonymous calls are allowed. If you set this parameter to ANONYMOUS, note the following items:
    • Anyone who can obtain the API service information can call the API. API Gateway does not authenticate the caller and cannot configure user-specific throttling. If you expose this API, configure API-specific throttling.

    • ANONYMOUS APIs are not recommended for listing in Alibaba Cloud Marketplace. API Gateway cannot meter calls by caller or limit the number of calls. If the group to which the API belongs is to be listed in Alibaba Cloud Marketplace, move the API to another group, set the visibility to Private, or select the Alibaba Cloud APP authentication method.

APP

RequestConfig

string

Yes

The configuration items for API requests sent from the consumer to API Gateway.

{"RequestProtocol":"HTTP","RequestHttpMethod":"GET","RequestPath":"/v3/getUserTest/[userId]","BodyFormat":"FORM","PostBodyDescription":""}

ServiceConfig

string

Yes

The configuration items for API requests sent from API Gateway to the backend service.

{"ServiceProtocol":"HTTP","ServiceHttpMethod":"GET","ServiceAddress":"http://www.customerdomain.com","ServiceTimeout":"1000","ServicePath":"/v3/getUserTest/[userId]"}

RequestParameters

string

No

The description of the parameters in API requests sent from 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" } ]

SystemParameters

string

No

The system parameters sent from API Gateway to the backend service.

[{\"location\":\"HEAD\",\"parameterName\":\"CaDomain\",\"serviceParameterName\":\"host\"}]

ConstantParameters

string

No

The constant parameters sent from API Gateway to the backend service.

[{\"ConstantValue\":\"123\",\"Description\":\"Constant parameter\",\"Location\":\"HEAD\",\"ServiceParameterName\":\"test\"}]

ServiceParameters

string

No

The description of the parameters in API requests sent from 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 mapping between the parameters in requests sent from the consumer to API Gateway and the parameters in requests sent from 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 returned by the backend service. Valid values: JSON, TEXT, BINARY, XML, and HTML. This parameter is used only to generate documentation and does not affect the response.

HTML

ResultSample

string

No

The sample response returned by the backend service. This parameter is used only to generate documentation and does not affect the response.

{}

FailResultSample

string

No

The sample error response returned by the backend service. This parameter is used only to generate documentation and does not affect the response.

{\"requestId\":\"3b9b8b31-93c3-489e-8ebb-cab35a1aee51\",\"errCode\":500,\"errMsg\":\"connection refused\"}

ErrorCodeSamples

string

No

The sample error codes returned by the backend service.

For more information, see ErrorCodeSample.

[{\"Code\":\"400\",\"Message\":\"Login failed\",\"Description\":\"Invalid user name or password\"}]

ResultDescriptions

string

No

The description of the API response.

{}

OpenIdConnectConfig

string

No

The OpenID Connect configuration items for third-party account authentication.

{\"OpenIdApiType\":\"IDTOKEN\",\"PublicKey\":\"lzlj1573\",\"IdTokenParamName\":\"\",\"PublicKeyId\":\"lzljorders\"}

AllowSignatureMethod

string

No

The signature method for client requests to the API. Valid values:

  • HmacSHA256

  • HmacSHA1,HmacSHA256

HmacSHA256

WebSocketApiType

string

No

The type of the bidirectional communication API. Valid values:

  • COMMON: Common API.

  • REGISTER: Registration API.

  • UNREGISTER: Unregistration API.

  • NOTIFY: Downstream notification.

COMMON

ResultBodyModel

string

No

The response body model of the API.

{}

ForceNonceCheck

boolean

No

  • If you set ForceNonceCheck to true, API Gateway forcibly checks the X-Ca-Nonce parameter in requests. This parameter is a unique identifier for the request and is generally a UUID. After API Gateway receives this parameter, it verifies the validity of the parameter. The same value can be used only once within 15 minutes. This effectively prevents replay attacks on the API.

  • If you set ForceNonceCheck to false, API Gateway does not check the parameter. If you do not specify this parameter when you modify the API, the original value is retained.

true

DisableInternet

boolean

No

  • If you set DisableInternet to true, the API can be called only over the internal network.

  • If you set DisableInternet to false, calls to the API are not restricted.

Note

If you do not specify this parameter when you modify the API, the original value is retained.

true

AppCodeAuthType

string

No

The authentication type that supports AppCode. Valid values:

  • DEFAULT: The default value. Supported after the API is listed in Alibaba Cloud Marketplace.

  • DISABLE: The AppCode call method is not supported.

  • HEADER: Supported only in the header.

  • HEADER_QUERY: Supported in the header or query string.

DEFAULT

BackendId

string

No

The ID of the backend service.

0d105f80a8f340408bd34954d4e4ff22

BackendEnable

boolean

No

Specifies whether to enable the backend service.

true

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

6C87A26A-6A18-4B8E-8099-705278381A2C

Examples

Success response

JSON format

{
  "RequestId": "6C87A26A-6A18-4B8E-8099-705278381A2C"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.