All Products
Search
Document Center

API Gateway:ModifyApi

Last Updated:Oct 19, 2024

Modifies the definition of an API.

Operation description

This operation is intended for API providers.

  • This API operation requires a full update. Updates of partial parameters are not supported.
  • When you modify an API name, make sure that the name of each API within the same group is unique.
  • When you modify the request path, make sure that each request path within the same group is unique.
  • The QPS limit on this operation is 50 per user.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
GroupIdstringYes

The ID of the API group.

927d50c0f2e54b359919923d908bb015
ApiIdstringYes

The ID of the API.

8afff6c8c4c6447abb035812e4d66b65
ApiNamestringYes

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

ApiName
DescriptionstringNo

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

Api description
VisibilitystringYes

Specifies whether the API is public. Valid values:

  • PUBLIC: Make the API public. If you set this parameter to PUBLIC, this API is displayed on the APIs page for all users after the API is published to the production environment.
  • PRIVATE: Make the API private. Private APIs are not displayed in the Alibaba Cloud Marketplace after the API group to which they belong is made available.
PUBLIC
AuthTypestringNo

The configuration items of API requests sent by the consumer to API Gateway.

APP
RequestConfigstringYes

The configuration items of API requests sent by API Gateway to the backend service.

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

The parameters of API requests sent by the consumer to API Gateway.

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

The parameters of API requests sent by the consumer to API Gateway.

For more information, see RequestParameter .

\[{\\"ParameterName\\": \\"CaAppId\\", \\"Location\\": \\"HEAD\\", \\"ServiceParameterName\\": \\"x-ca-appid\\"}]
SystemParametersstringNo

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

[{\"ParameterName\": \"CaAppId\", \"Location\": \"HEAD\", \"ServiceParameterName\": \"x-ca-appid\"}]
ConstantParametersstringNo

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

[{\"ServiceParameterName\":\"HOST\",\"ConstantValue\":\"uat-cgi.smarket.net.cn\",\"Location\":\"HEAD\",\"Description\":\"\\u540e\\u7aefVPC-HOST\"}]
ServiceParametersstringNo

The parameters of API requests sent by API Gateway to the back-end service.

For more information, see ServiceParameter .

[{"ServiceParameterName":"age","Location":"Head","Type":"Number","ParameterCatalog":"REQUEST"},{"ServiceParameterName":"sex","Location":"Query","Type":"String","ParameterCatalog":"REQUEST"},{"ServiceParameterName":"userId","Location":"Path","Type":"Number","ParameterCatalog":"REQUEST"},{"ServiceParameterName":"clientIp","Location":"Head","Type":"String","ParameterCatalog":"SYSTEM"},{"ServiceParameterName":"constance","Location":"Head","Type":"String","ParameterCatalog":"CONSTANT"}]
ServiceParametersMapstringNo

The mappings between parameters of requests sent by the consumer to API Gateway and parameters of requests sent by API Gateway to the back-end service.

For more information, see ServiceParameterMap .

[{"ServiceParameterName":"age","RequestParameterName":"age"},{"ServiceParameterName":"sex","RequestParameterName":"sex"},{"ServiceParameterName":"userId","RequestParameterName":"userId"},{"ServiceParameterName":"clientIp","RequestParameterName":"CaClientIp"},{"ServiceParameterName":"constance","RequestParameterName":"constance"}]
ResultTypestringYes

The sample response from the backend service.

HTML
ResultSamplestringYes

The sample response that is returned from the backend service. This value is used only to generate documents. It does not affect the actually returned result.

200
FailResultSamplestringNo

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"}
ErrorCodeSamplesstringNo

The sample error codes returned by the backend service.

For more information, see ErrorCodeSample .

[{"Code":"400","Message":"Missing the userId","Description":"param invalid"}]
ResultDescriptionsstringNo

The descriptions of API responses.

[]
OpenIdConnectConfigstringNo

The client-side request signature method of the API. Valid values:

  • HmacSHA256
  • HmacSHA1,HmacSHA256
{\"OpenIdApiType\":\"IDTOKEN\",\"PublicKey\":\"lzlj1573\",\"IdTokenParamName\":\"\",\"PublicKeyId\":\"lzljorders\"}
AllowSignatureMethodstringNo

The type of the two-way communication API. Valid values:

  • COMMON: general APIs
  • REGISTER: registered APIs
  • UNREGISTER: unregistered APIs
  • NOTIFY: downstream notification
HmacSHA256
WebSocketApiTypestringNo

The returned description of the API.

COMMON
ResultBodyModelstringNo
  • Specifies whether to set ForceNonceCheck to true to force the check of X-Ca-Nonce during the request. This is the unique identifier of the request and is generally identified by UUID. After receiving this parameter, API Gateway verifies the validity of this parameter. The same value can be used only once within 15 minutes. This helps prevent replay attacks.
  • If you set ForceNonceCheck to false, the check is not performed. If you do not set this parameter, the original value is used.
{}
ForceNonceCheckbooleanNo
  • Specifies whether to set DisableInternet to true to limit API calls to within the VPC.
  • If you set DisableInternet to false, the limit if lifted.
Note If you do not set this parameter, the original value is used.
true
DisableInternetbooleanNo

The AppCode authentication type supported. Valid values:

  • DEFAULT: supported after being made available in Alibaba Cloud Marketplace
  • DISABLE: not supported
  • HEADER : supported only in the Header parameter
  • HEADER_QUERY: supported in the Header or Query parameter
true
AppCodeAuthTypestringNo

The ID of the backend service.

DEFAULT
BackendIdstringNo

Specifies whether to enable backend services.

0d105f80a8f340408bd34954d4e4ff22
BackendEnablebooleanNo

Configuration Mode

true

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

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

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 timeSummary of changesOperation
2024-01-26The internal configuration of the API is changed, but the call is not affectedView Change Details