This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Create APIs using a Swagger URL

You can use publicly hosted Swagger files to create APIs using WSO2 API Cloud. There are 2 methods to create an API using a Swagger file.

Only Swagger 2.0 file format is supported. If your file is of an earlier version, please upgrade it prior to using it in WSO2 API Cloud.


Designing a new API with a Swagger File

The steps below show how to create an API using a Swagger file.

  1. Log in to the API Cloud and the API Publisher will open automatically. Start creating an API by selecting Design new API and clicking Start Creating.

  2. In API Definition click Import to import all the associated methods and parameters. 
  3. In the dialog box that appears, select Swagger URL. Paste the URL given below and click Import.
    Sample URL : https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v2.0/json/petstore-simple.json
    The fields above should be automatically filled.
  4. Fill any empty fields with the information in the table below.

    FieldSample Value
    NamePetStoreAPI
    Context/petstore
    Version1.0.0
    VisibilityPublic
  5. Continue on to the Manage section to edit, save and/or publish the API. 

Create a new API using an existing API definition

If you already have an existing API you can use the Swagger definition to replicate it.

  1. Go to Add New API and select I have an existing API. 
  2. In the dropdown section, select Swagger URL and paste the URL of your hosted Swagger definition. 
  3. Click Start Creating to proceed to the next step. You can also upload a Swagger file instead of the URL.


For more details on creating and publishing APIs on WSO2 API Cloud, see Create and Publish an API.