API Gateway 10.15 | Getting Started with API Gateway | Create your first REST API | Creating a REST API by importing an API from a URL
 
Creating a REST API by importing an API from a URL
Let's look at a sample scenario, where you are importing https://petstore.swagger.io/v2/swagger.json URL to create the Petstore REST API.
Before you begin
Ensure that you have
*The URL from where you want to import the API
*Manage APIs or Activate / Deactivate APIs functional privilege. If you are an Administrator you would have this privilege by default.
*To create a REST API by importing an API from a file
1. Click APIs in the title navigation bar.
2. Click Create API.
3. Select Import from URL.
Import API from file
4. Provide the URL as https://petstore.swagger.io/v2/swagger.json.
As the provided URL is public, you do not have to select the Protected check box. If you have given the restricted access URL and if the URL is password protected, then you must select the Protected check box. After you select the Protected check box, API Gateway displays the Username and Password fields. Make sure you provide the login credentials of the given restricted access URL.
Based on the specification used in the imported file, API Gateway auto populates the Type field. REST API supports the Open API, RAML,or Swagger specifications. As the https://petstore.swagger.io/v2/swagger.json URL is a swaggerfile, API Gateway, by default, selects the file type as Swagger.
5. Provide the API name as Petstore in the Name field.
6. Provide the version number as 1.0 in the Version field.
7. Select the Type as Swagger as the imported Search Cruise API is a swagger file.
8. Provide a description as Import REST API using URL in the Description field.
9. Select the team as Administrator for which you want to assign the Petstore in the Team field.
This field appears only when the Team feature is enabled. It displays only the teams that you are a part of.
10. Click Create.
The Petstore API is created and the API details screen displays.
REST API details
You can use this Petstore API for the following:
*Find purchase order in a pet store by Order ID
*Get the pet store’s inventory status
Next Steps
Now that you have created the REST API, you must
*Check whether the Petstore API is imported properly by using any of the API testing tools. For details on how to test the API, see Testing a REST API