tencent cloud

All product documents
API Gateway
Importing APIs
Last updated: 2023-12-22 09:48:22
Importing APIs
Last updated: 2023-12-22 09:48:22

Overview

This document describes how to create an API by importing an OpenAPI file in the API Gateway console.

Prerequisites

You have an OpenAPI 3.0.0 API description file in YAML or JSON format.

Directions

1. Log in to the API Gateway console and click Service on the left sidebar.
2. In the service list, click the name of the target service.
3. In the service details, click the Manage API tab to view the API list of the service.
4. Click Import API above the API list to enter the API importing page.
5. Select the Text format (YAML or JSON), click Upload File, and select API description files, or directly enter the API descriptions in the code editor.
6. Click Save, and API Gateway will create APIs based on the descriptions and then return a list of successfully created APIs.




Notes

OpenAPI 3.0.0 API description files in YAML or JSON format are supported.
You can import up to ten APIs at a time.
The uploaded API description files must be suffixed with ".yml" or ".json", and each file can be up to 100 KB in size. The uploaded description files will overwrite the content in the code editor.
An API created successfully will not be published automatically and needs to be published manually to take effect.
To import an API from an OpenAPI 3.0.0 description file, you need to manually add the servers field to define the backend address to be accessed by the API, for example:
servers:
- url: 'http://localhost:8080'
description: Generated server url

Note:
For more information on the mapping between OpenAPI specifications and API Gateway, see Defining APIs.
For detailed directions, see Importing APIs.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon