Test and Explore APIs
As an administrators or API owner, you can test and explore the APIs you published on the using the API Explorer. The API Explorer shows only the APIs that have WADL or Swagger .json files.
As an administrator or API owner, you can test and explore the APIs you published on the
API Developer Portal
using the API Explorer or the Swagger UI. The API Explorer and Swagger UI only display APIs that have WADL or Swagger .json files.API Explorer is only accessible through the API Portal/Ingress tenant. If you are using an external tenant, test and explore APIs using the Swagger UI instead.
You can select an API and can configure a query using API Explorer or Swagger UI. This function uses information in a well-crafted WADL or Swagger .json file and displays information about the API, resource, method, and parameters that you select for the query. A request is submitted against the API and a call is routed to the endpoint specified in the file. If multiple clusters of API proxies are present, you can point the endpoint that is specified in the WADL or Swagger file to a particular cluster or a virtual IP address.
If the API you are publishing is secured using OAuth 2.0, ensure that the end point specified in the WADL or Swagger file is also specified in the Authentication section of the API Metadata tab.
When you send the query, the API Explorer or Swagger UI displays the query string and the API results. It can also display error messages.
You can translate the generated query into one of the following programming languages:
- cURL
- Java
- JavaScript
- Node.js
- Objective C
- PHP
- Python
- Ruby
Test and Explore API using API Explorer
To test and explore an API using API Explorer:
- Log in to the API Portal.
- Selectoneof the following methods:
- Use API Explorer. SelectPublish,API Explorer, and select an API.
- SelectPublish,APIs, select the menu icon for the API that you want to test, and then selectTest.
- If the API requires authentication, perform the following substeps:
- From the App/API Key menu, select an application. The API Explorer uses the application API key and shared secret.When using the Portal API or Metrics API in the API Explorer, selectPortal API app... from the App/API Key menu.
- SelectConfigure Authentication.
- Select the authentication type that the API requires.More fields appear. The fields depend on the authentication type.
- Complete the fields that the authentication type requires.
- SelectOK.
- Select a resource in the API.
- Select a method available for the resource. If the method requires a parameter value, then enter a valid value.API Portal supportsapplication/jsonas the parameter content type. To viewapplication/xmlas the parameter type, manually convert the payload as an XML type, and paste as a body.
- (Optional) If you want to add another parameter that the API supports, then perform the following substeps:
- SelectAdd Parameter.
- Specify the parameter type: query, header, or template.Template parameters are URI parameters that are enclosed in { }. Template parameters must be substituted before the URI can be resolved.
- Enter the parameter name and value.
- SelectOK.
- SelectSubmit.The API Explorer displays the query that it sent to the API and the response from the API.
- To translate the query to another programming language, select the language from the menu.
To go from the API Explorer to the API Portal Home page, select the name of your API Portal.
Test and Explore API using Swagger UI
To test and explore an API using Swagger UI:
- Navigate toPublish > APIs.
- Select the API you wish to view. TheAPI Detailspage opens.
- Click theSpectab to open the Swagger UI.
- Ensure your session is authorized.If applicable, thePadlockbutton next to your selected endpoint indicates whether an endpoint is locked. If required, authorize your session by clicking thePadlockbutton and completing the information required in theAuthorizationwindow.
- Expand your selected endpoint, and clickTry it out.
- The example values in theRequest Bodyfield becomes editable. Make changes to the example request, and clickExecute.