Applies to ReadyAPI 3.0, last modified on November 12, 2019

Your project may interact with more than one API. This topic explains how you can add more APIs to your project.

Add API dialog

You add APIs in the Add API dialog. To open it:

  • Click Plusnext to the APIs node.

    Show image

— or —

  • Right-click the APIs section in the Navigator and select Add API.

    Show image

ReadyAPI will show the Add API dialog:

Add API to ReadyAPI project

Click the image to enlarge it.

The dialog has the following tabs:

Definition

Use this tab to add API from a definition file: WADL, Swagger/OpenAPI, WSDL or GraphQL.

Endpoint

Use this tab to add REST API by using its resources URLs.

Discover API

Use this tab to record requests while you are working with the service.

Add API by using definition file

In the Definition tab, you can add APIs by using API’s definition: WADL, Swagger/OpenAPI, WSDL, or GraphQL.

Note: You can also import definitions from SwaggerHub. See how to do it below.

Specify the address of the definition file in the URL or File Path field and click Add API:

Add API to ReadyAPI project

Click the image to enlarge it.

ReadyAPI defines the definition type automatically. If you need to specify advanced options, select the needed type manually from the Type drop-down list.

Below, you can find descriptions of the Advanced options for different definition types:

  • Create a test case for the imported WADL - Select this option if you want ReadyAPI to generate a test case.

  • Default Media Type - Specifies the media type that ReadyAPI will use for the requests in which no media type is specified.

  • Create sample requests for all operations - Creates sample requests for all WSDL operations.

    Show Example

  • Create a test case for the imported WSDL - Generate test cases for each operation in WSDL.

  • Create a virtual service for the imported WSDL - Creates a virtual API based on the imported WSDL.

New REST service from Endpoint

Use the Endpoint tab to append a new REST service to your project and add the specified request to it.

Adding a new REST Service from an endpoint

Click the image to enlarge it.

  1. Select the needed HTTP method from the Method drop-down list.

  2. Enter the full URL, including the protocol, hostname, and parameters to the Endpoint field. The host name will become the service name in the Navigator tree. The resource path will become the resource name. ReadyAPI will also read query parameters and add them to a new request in the UI.

  3. If you want to add more resources, click Add Endpoint and repeat the steps.

    Tip: To remove the added endpoint, click Remove next to it.

You may encode non-alphanumeric characters in the URL (for example, type %20 instead of spaces), or you may leave these characters as they are: ReadyAPI will read them correctly in both cases.

Other ways to add APIs

To import public or private definitions from SwaggerHub:

  1. Right-click the APIs node and select Import From SwaggerHub:

    SwaggerHub in ReadyAPI: Importing SwaggerHub definition
  2. If you use SwaggerHub cloud service, use the predefined URL.

    -- or --

    If you use SwaggerHub On-Premise, select the Use on-prem URL check box. After that, specify the URL of your SwaggerHub On-Premise instance in the URL edit box.

  3. Log in to your SwaggerHub account by entering the account credentials in the Login and Password fields.

    You can log in to SwaggerHub using only your SwaggerHub account, not a GitHub one.
  4. Select the Remember me check box if you want to save your SwaggerHub account information.

  5. Enter the name, owner, title, or description of the needed definition in the Search field and click Search.

    Tip: The Search field is case-insensitive. Multiple words, for example, petstore server, are treated as an exact substring search, that is, all the words in that exact order. You do not need to enclose the phrase in quotation marks.
  6. Select the My APIs only check box to filter out the search results.

  7. Select a definition in the table. If the definition has multiple versions, select the needed one in the Versions column.

  8. Click OK.

Importing an OpenAPI (Swagger) definition from SwaggerHub

Click the image to enlarge it.

You can also publish your API definition to SwaggerHub or SwaggerHub On-Premise. See Export to SwaggerHub for details.

If you cannot connect to SwaggerHub using your credentials, try regenerating API keys in SwaggerHub:

  1. Open the account settings in SwaggerHub:

    SwaggerHub integration: Account settings.
  2. Switch to the API Keys tab and click Regenerate:

    SwaggerHub integration: Regenerating API keys.

    Click the image to enlarge it.

Please note that, if you use these keys to access SwaggerHub’s public API, you need to update them in your code, as well.

To add an XML-RPC service to your project:

  1. Right-click the APIs node and select Import From SwaggerHub:

    SwaggerHub in ReadyAPI: Importing SwaggerHub definition
  2. In the subsequent dialog, enter your service .rem URL:

    Adding the new XML-RPC Service from URL

    Click the image to enlarge it.

  3. To create sample requests, select the Create Requests.

  4. Click OK.

See Also

Extend Existing APIs
Organizing APIs

Highlight search results