tencent cloud

APIs

CreateOrModifyCloudNativeAPIGatewayCORS

フォーカスモード
フォントサイズ
最終更新日: 2026-05-08 14:40:11

1. API Description

Domain name for API request: tse.intl.tencentcloudapi.com.

Create or edit a cloud-native gateway cross-domain configuration

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateOrModifyCloudNativeAPIGatewayCORS.
Version Yes String Common Params. The value used for this API: 2020-12-07.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
GatewayId Yes String Gateway ID
SourceType Yes String Resource type bound to the cross-origin plug-in: route
SourceId Yes String id of the route or service
Enabled Yes Boolean Whether to enable the plug-in
Origins.N No Array of String Cross-Origin Access-Control-Allow-Origin
Headers.N No Array of String Cross-Origin Access-Control-Allow-Headers header
Methods.N No Array of String Access-Control-Allow-Methods for CORS
ExposedHeaders.N No Array of String Access-Control-Expose-Headers
MaxAge No Integer preflight request cache time
Credentials No Boolean Access-Control-Allow-Credentials for CORS
PreFlightContinue No Boolean Whether to pass through the OPTIONS request to the backend

3. Output Parameters

Parameter Name Type Description
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Creating CORS Configuration

Input Example

POST / HTTP/1.1
Host: tse.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateOrModifyCloudNativeAPIGatewayCORS
<Common request parameters>

{
    "GatewayId": "gateway-3e49c57e",
    "SourceType": "route",
    "SourceId": "462885df-28d0-4b57-b7c3-6b7e22d08799",
    "Enabled": true,
    "Origins": [
        "GET"
    ],
    "Headers": [
        "header"
    ],
    "Methods": [
        "GET"
    ],
    "ExposedHeaders": [
        "respHeader"
    ],
    "MaxAge": 30,
    "Credentials": false,
    "PreFlightContinue": false
}

Output Example

{
    "Response": {
        "RequestId": "88e7aa4b-de0a-46b2-817c-435ddc736694"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation Operation failed.
FailedOperation.FailedOperation Operation failed.
FailedOperation.InternalError Operation failed. Internal error.
FailedOperation.Role Failed to get temporary key
FailedOperation.Vpc Failed to call the VPC service
InternalError Internal error.
InternalError.QueryError Query internal error.
InternalError.UnknownError Unknown error.
InvalidParameterValue.BadRequestFormat Request format incorrect.
InvalidParameterValue.InvalidParameterValue Invalid parameter value.
InvalidParameterValue.OperationFailed Invalid request parameter caused operation failure.
InvalidParameterValue.Region Invalid Region.
InvalidParameterValue.ResourceAlreadyExist The resource already exists.
InvalidParameterValue.Specification Gateway specification parameter content error
InvalidParameterValue.Type Gateway type parameter content error
MissingParameter Parameters are missing.
MissingParameter.MissParameter Missing required parameters.
ResourceNotFound.InstanceNotFound The instance does not exist.
ResourceNotFound.ResourceNotFound The resource does not exist.
UnauthorizedOperation.CamNoAuth Authentication fail.
UnauthorizedOperation.CamPassRoleNotExist The sub-account lacks passRole permission.
UnauthorizedOperation.Uin Unauthorized Uin
UnauthorizedOperation.UnauthorizedOperation Unauthorized operation.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック