Creating a REST API by importing an API from a file

Before you begin

Ensure that you have

  • Downloaded the REST API file with the needed specifications.
  • Manage APIs or Activate / Deactivate APIs functional privilege.
    Note: If you are an Administrator, you have this privilege by default.

About this task

This example explains how you can create a REST API by importing the SearchCruise file.

Procedure

  1. Open the menu options and select APIs.
  2. Click Create API.
  3. Select Import API from file.
  4. Click Browse and select the SearchCruise.zip file.
  5. Click Open.
    Note: If the Swagger parser is a self-contained file with no external references, you can upload directly. If the imported REST API file contains external references, the entire set of files must be uploaded as a compressed file with a structure as referenced by the imported file. In such case, the webMethods API Gateway displays the Root File Name field. Provide the root file name in the compressed folder that you want to import. In this example, the root file name is SearchCruise.json
  6. Provide the API name as Search Cruise in the Name field.
    • If you provide an API name, webMethods API Gateway overwrites the API name that is specified in the uploaded file.
    • If you do not provide an API name, webMethods API Gateway retains the API name that is mentioned in the uploaded file.
    • If you do not provide an API name and the uploaded file does not have an API name, the API name is displayed as Untitled.
  7. Provide the version number as 1.0 in the Version field.
  8. Select the type as Swagger since the imported Search Cruise API is a swagger file.
  9. Provide a description as Import search cruise API in the Description field.
  10. Select the team as Administrator for which you want to assign the Search Cruise in the Team field.
    Note: This field appears only when the team feature is enabled. It displays only the teams that you are a part of. If you have the User management functional privilege, all teams are displayed. You can select more than one team.
  11. Click Create. The Search Cruise API is created to search a cruise by cruise ID.
  12. Now that you created the SearchCruise API, you can check whether it is imported properly by using any of the API testing tools. To know more about how to test the REST API that uses Postman, see Testing a REST API.