Preparing an API for debugging with the Test tab
Ensure that your API's definition meets the requirements for debugging it in the API Connect Test tab.
You can complete this task either by using the API Designer UI application, or by using the browser-based API Manager UI.
To invoke your API in the Test tab, the following requirements must be satisfied:
- The DataPower API Gateway is configured to support the API probe
- To enable the Test tab's trace feature, the DataPower API Gateway must be configured to support gateway peering and the gateway probe. In a gateway service running in Kubernetes, the API probe is automatically enabled. In a gateway service running external to Kubernetes, the DataPower configuration must be added to the application domain supporting API Connect. Check with your administrator to confirm that gateway peering and the gateway probe are enabled as explained in Configuring DataPower API Gateway.
- CORS is enabled in the API definition
- Cross-Origin Resource Sharing support ensures that the API can be accessed from another domain.
CORS support must be enabled for your API to be properly invoked and traced. If your API uses the
API Gateway but you cannot open the Test tab, it's possible that CORS was not enabled in the API
definition.
You can enable CORS for you API by completing the following steps:
- Log in to API Manager.
- In the navigation list, click Develop.
- On the Develop page, click the name of the API you want to test. The API's Design page appears.
- Under the Gateway tab, locate the CORS field and select it to enable support.
- Click Save in the page header.
- The API is published in the Sandbox catalog with the default Product/Plan, or a specified catalog and Product/Plan
- By default, when you test an API with the Test tab, a default
Product/Plan is generated for the API and published to the built-in Sandbox Catalog. However, you
can optionally specify a range of API testing preferences including an alternative Product/Plan, and
target Catalog; for more information, see Specifying the testing preferences for an API. When
you publish (activate) an API, the API is enabled online and becomes available for use. You cannot
execute an offline API, even for testing purposes. You can set an API online by completing the
following steps:
- Log in to API Manager.
- In the navigation list, click Develop.
- On the Develop page, click the name of the API you want to test.
- In the Design page header, click the settings icon . The Preferences page appears.
- Set the Auto-publish toggle to On position.