Testing an API with the assembly test tool

IBM® API Connect provides a test environment for you to ensure that your APIs are defined and implemented correctly.

Before you begin

If you want to test an API offline, API Connect provides the following options:
  • Call the API in the Local Test Environment with a cURL command, as described in Testing an API with the Local Test Environment.
  • Invoke the API from the locally installed API Designer UI application running in Online mode as described in the following sections.

About this task

You can complete this task either by using either the API Designer UI application, or by using the browser based API Manager UI.

Note:
  • If you are testing an API that contains references to API properties, only those references that are defined inside the API assembly are resolved and replaced with their corresponding values when you invoke the API in the assembly test tool; property references that are defined outside of the API assembly are not resolved. For more information on API properties, see Setting API properties.
  • Due to Cross-Origin Resource Sharing (CORS) restrictions, the assembly test tool cannot be used with the Chrome or Safari browsers on the macOS Catalina platform.

Procedure

To test an API, complete the following steps.

  1. If you are using API Designer, set the mode to Online using the Options menu Options menu on the main page.
  2. In the navigation pane, click Develop icon in the API UI navigation pane Develop, then select the APIs tab.
  3. Click the API definition that you want to work with.
  4. Click Assemble to open the Assemble view, then click the Test icon Test icon (right arrow).
  5. If, you are testing the API for the first time and, when you created the API definition, you selected the Activate API option, your test setup will already be configured and you can proceed immediately to the next step to test your API. Otherwise, click Activate API to have your test setup configured.
    Note: If you are retesting your API after making changes, click Republish product to make your changes available.
  6. In the Operation section, select the API operation that you want to test, then click Invoke.
    The API response is displayed in the Response section.
    Note: If you receive a message relating to an untrusted certificate, click the link provided, accept the certificate, then return to the test environment and click Invoke again. The message also mentions a lack of CORS support on the server, but this is just one possible cause for the connection failing.