Domain name for API request: apigateway.tencentcloudapi.com.
This API is used to import an OpenAPI to API gateway.
A maximum of 20 requests can be initiated per second for this API.
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: ImportOpenApi. |
Version | Yes | String | Common Params. The value used for this API: 2018-08-08. |
Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
ServiceId | Yes | String | The unique ID of the service associated with the API |
Content | Yes | String | Content of the openAPI |
EncodeType | No | String | Format of the content. Values: YAML (default), JSON |
ContentVersion | No | String | Version of the content. It can only be openAPI for now. |
Parameter Name | Type | Description |
---|---|---|
Result | CreateApiRspSet | The result of importing the OpenAPI |
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. |
POST / HTTP/1.1
Host: apigateway.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ImportOpenApi
<Common request parameters>
{
"ServiceId": "service-xxxxx",
"EncodeType": "YAML",
"Content": "info:\n title:test\n version: 1.0.1\nopenapi: 3.0.0\npaths:\n /:\n get:\n operationId: test\n responses:\n '200':\n description: The list of possible responsesas they are returned from executing\n this operation.\n x-apigw-api-business-type: NORMAL\n x-apigw-api-type: NORMAL\n x-apigw-backend:\n MockReturnHttpHeaders: []\n MockReturnHttpStatusCode: 200\n ServiceMockReturnMessage: ok\n ServiceType: MOCK\n x-apigw-cors: false\n x-apigw-protocol: HTTP\n x-apigw-service-timeout: 15\n",
"ContentVersion": "openAPI"
}
{
"Response": {
"Result": {
"TotalCount": 1,
"ApiSet": [
{
"ApiName": "test",
"Path": "/",
"Method": "GET",
"Status": "success",
"ErrMsg": "",
"ApiId": "api-xxxxxxx",
"CreatedTime": "2020-09-22T00:00:00+00:00"
}
]
},
"RequestId": "61cb6d76-xxxx-xxxx-xxx-xxxxxxxxxx"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
AuthFailure | Error with CAM signature/authentication. |
FailedOperation.ApiError | API error. |
InternalError | Internal error. |
InternalError.OssException | OSS internal request error. Please try again. If the problem persists, please contact the smart customer service or submit a ticket. |
InvalidParameter.FormatError | Incorrect parameter format. |
InvalidParameterValue | The parameter value is incorrect. |
InvalidParameterValue.InvalidServiceConfig | Invalid service configuration. |
InvalidParameterValue.UnsupportedParameter | Invalid parameter value. |
LimitExceeded.ApiCountLimitExceeded | The number of APIs exceeds the limit. |
MissingParameter.BackendSpecificParam | The backend service parameter is missing. |
ResourceNotFound | The resource does not exist. |
UnauthorizedOperation.AccessResource | You do not have permission to access the resource. |
UnsupportedOperation.InvalidAction | API error. |
UnsupportedOperation.UnpackError |
本页内容是否解决了您的问题?