Modify API

Last updated: 2020-06-09 14:53:19

    Note:

    This is a legacy API which has been hidden and will no longer be updated. We recommend using the new API Gateway API 3.0 which is standardized and faster.

    Interface description

    This API (ModifyApi) is used to modify API. You can call this API to edit and modify the configured API. The modified API needs to restore the service of publish API to the corresponding environment before it can take effect.

    Input Parameter

    The following request parameter list only lists the API request parameters. For other parameters, please see Common Request Parameters .

    Parameter name Required Type Description
    ServiceId Yes String The service on which API is located is the only ID.
    ApiId Yes String API is the only ID.
    ApiName No String User-defined API name.
    AuthRequired No String Whether you need to sign Verification, TRUE means yes, FALSE means no.
    EnableCORS No String Whether it is necessary to enable cross-domain, TRUE means yes, FALSE means not.
    ApiDesc No String User-defined API description.
    RequestConfig.path No String The front-end path to the API, such as / path.
    RequestConfig.method No String The front-end request method of API, such as GET.
    RequestConfig.protocol No String The front-end request type of API, such as HTTP or HTTPS or HTTP and HTTPS.
    RequestParameters.n.name No String The name of the front-end parameter of the API.
    RequestParameters.n.position No String The position of the front-end parameter of the API, such as head. Head, qurey and path are currently supported.
    RequestParameters.n.type No String The frontend parameter types of API, such as String and int.
    RequestParameters.n.defaultValue No String Default values of frontend parameters for API.
    RequestParameters.n.required No Boolean Whether the frontend parameter of API is required. TRUE: means required, and FALSE: means optional.
    RequestParameters.n.desc No String Remarks for the front-end parameters of API.
    ServiceType No Boolean Three back-end service types of API are now supported: HTTP,MOCK and SCF.
    ServiceTimeout No Int API's backend service timeout (in seconds).
    ServiceConfig.url No String Url, the back-end service of API. This parameter is required if serviceType is HTTP,.
    ServiceConfig.path No String The backend service path of API, such as / path. This parameter is required if serviceType is HTTP,. The front and rear paths can be different.
    ServiceConfig.method No String The backend service request method of API, such as GET. This parameter is required if serviceType is HTTP,. The front and back end methods can be different.
    ServiceParameters.n.name No String The name of the backend service parameter of the API. This parameter is used only if serviceType is HTTP. The names of the front and rear parameters can be different.
    ServiceParameters.n.position No String The location of the backend service parameter of the API, such as head. This parameter is used only if serviceType is HTTP. The position of the front and rear parameters can be configured differently.
    ServiceParameters.n.relevantRequestParameterName No String The name of the frontend parameter corresponding to the backend service parameter of API. This parameter is used only if serviceType is HTTP.
    ServiceParameters.n.relevantRequestParameterPosition No String The location of the frontend parameter corresponding to the backend service parameter of API, such as head. This parameter is used only if serviceType is HTTP.
    ServiceParameters.n.desc No String Remarks on the backend service parameters of API. This parameter is used only if serviceType is HTTP.
    ConstantParameters.n.name No String Constant parameter name. This parameter is used only if serviceType is HTTP.
    ConstantParameters.n.desc No String Constant parameter description. This parameter is used only if serviceType is HTTP.
    ConstantParameters.n.position No String Constant parameter position. This parameter is used only if serviceType is HTTP.
    ConstantParameters.n.defaultValue No String Constant parameter default value. This parameter is used only if serviceType is HTTP.
    ServiceMockReturnMessage No String The backend Mock of API returns information. This parameter is required if serviceType is Mock,.
    ServiceScfFunctionName No String The name of the backend SCF function of the API. This parameter is required if serviceType is SCF,.
    serviceScfFunctionQualifier No String The version of the backend SCF function of the API. This parameter is required if serviceType is SCF,.
    ResponseType No String Custom response configuration return type, which only supports HTML, JSON, TEST, BINARY and XML.
    ResponseSuccessExample No String Custom response configuration successful response example.
    ResponseFailExample No String Custom response configuration failure response example.
    ResponseErrorCodes.n.code No String Custom response configuration error code.
    ResponseErrorCodes.n.msg No String Custom response configuration error message.
    ResponseErrorCodes.n.desc No String Custom response configuration error code comments.
    IsDeleteResponseErrorCodes No String Whether to delete the custom response configuration error code. If it is not passed or FALSE, is not deleted, when TRUE is passed, all custom response configuration error codes of this API will be deleted.

    Output Parameter

    Parameter name Type Description
    Code Int Common error code, 0 indicates success, other values indicate failure. For more information, please see the error code page Common error code .
    CodeDesc String Error code on the business side. If a Success, error is returned on success, the cause of the business error is returned.
    Message String Module error message description, related to the interface.

    Example

    Modify a API: whose backend service is HTTP
    An example of a request is as follows:

    https://apigateway.api.qcloud.com/v2/index.php?
    &<Common request parameters>
    &Action=ModifyApi
    &serviceId=service-XX
    &apiId=api-XX
    &apiDesc=myTestApi
    &requestConfig.path=/path
    &requestConfig.method=GET
    &requestConfig.protocol=Http
    &requestParameters.0.name=age
    &requestParameters.0.location=head
    &requestParameters.0.type=Int
    &requestParameters.0.defaultValue=18
    &requestParameters.0.required=REQUIRED
    &requestParameters.0.description=age
    &serviceType=Http
    &serviceTimeout=60
    &serviceConfig.url=cloud.tencent.com
    &serviceConfig.path=/path
    &serviceConfig.method=GET
    &serviceParameters.0.name=age
    &serviceParameters.0.location=head
    &serviceParameters.0.relevantRequestParameterName=age
    &serviceParameters.0.relevantRequestParameterIn=head
    &serviceParameters.0.defaultValue=18
    &serviceParameters.0.description=age

    The returned results are as below:

    {
        "code":"0",
        "message":"",
        "codeDesc":"Success"
    }

    Modify a API: whose backend service is MOCK
    An example of a request is as follows:

    https://apigateway.api.qcloud.com/v2/index.php?
    &<Common request parameters>
    &Action=ModifyApi
    &serviceId=service-XX
    &apiId=api-XX
    &apiDescription=myTestApi
    &requestConfig.path=/path
    &requestConfig.method=GET
    &requestConfig.protocol=Http
    &requestParameters.0.name=age
    &requestParameters.0.location=head
    &requestParameters.0.type=Int
    &requestParameters.0.defaultValue=18
    &requestParameters.0.required=REQUIRED
    &requestParameters.0.description=age
    &serviceType=MOCK
    &serviceTimeout=60
    &serviceMockReturnMessage=Returned message from MOCK

    The returned results are as below:

    {
        "code":"0",
        "message":"",
        "codeDesc":"Success"    
    }

    Modify a API: whose backend service is SCF
    An example of a request is as follows:

    https://apigateway.api.qcloud.com/v2/index.php?
    &<Common request parameters>
    &Action=ModifyApi
    &serviceId=service-XX
    &apiId=api-XX
    &apiDescription=myTestApi
    &requestConfig.path=/path
    &requestConfig.method=GET
    &requestConfig.protocol=Http
    &requestParameters.0.name=age
    &requestParameters.0.location=head
    &requestParameters.0.type=Int
    &requestParameters.0.defaultValue=18
    &requestParameters.0.required=REQUIRED
    &requestParameters.0.description=age
    &serviceType=SCF
    &serviceTimeout=60
    &serviceScfFunctionName=myScfFunction

    The returned results are as below:

    {
        "code":"0",
        "message":"",
        "codeDesc":"Success"   
    }

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help