Test and Explore APIs

As a Portal Admin or API Owner, you can test and explore the APIs you published on the
API Portal
using the API Explorer. The API Explorer shows only the APIs that have WADL or Swagger .json files.
As a Portal Admin or API owner, you can test and explore the APIs you published in
Layer7 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.
You can test and explore APIs using the API Explorer only by accessing it 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 the 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 that you are publishing is secured using OAuth 2.0, ensure that you specify the end point specified in the WADL or Swagger file in the
Spec Authentication
section of the API.
For more information about how to configure the authentication settings for testing APIs, Create and Set Permissions for APIs.
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, and Ruby
Test and Explore API using API Explorer
Follow these steps:
  1. Log in to
    API Portal
    as a Portal Admin or API Owner.
  2. Select
    of the following methods:
    • Use API Explorer. Select
      Portal API
      API Explorer
      , and then select an API.
    • From the menu bar, select
      , select the menu icon for the API that you want to test, and then select
  3. If the API requires authentication, perform the following substeps:
    1. From the
      App/API Key
      menu, select an application. The API Explorer uses the default API key and shared secret.
      When using the Portal API (PAPI) or Metrics API in the API Explorer, select
      Portal API App
      ... from the
      App/API Key
    2. Select
      Configure Authentication
    3. Select the authentication type that the API requires.
      More fields appear. The fields depend on the authentication type.
    4. Complete the fields that the authentication type requires, and then select
  4. Select a resource in the API.
  5. Select a method available for the resource. If the method requires a parameter value, then enter a valid value.
    API Portal
    as the parameter content type. To view
    as the parameter type, manually convert the payload as an XML type, and paste as a body.
  6. (Optional) If you want to add another parameter that the API supports, then perform the following substeps:
    1. Select
      Add Parameter
    2. 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.
    3. Enter the parameter name and value, and then select
  7. Select
    The API Explorer displays the query that it sent to the API and the response from the API.
  8. 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
Follow these steps:
  1. While logged in to
    API Portal
    as a Portal Admin or API Owner, select
    A list of APIs display on the APIs page.
  2. Select the API that you want to test and explore.
    tab opens.
  3. Select the
    The Swagger UI opens.
  4. From the drop-down, select the application for which you want to test and explore this API. If the API is not included in an application, you can click
    Create an Application
    to add one.
    A second drop-down appears for your to select your API key.
  5. From the second drop-down, select your API key.
    The API key (client ID) and the shared secret (client secret) (if the shared secret was generated in plaintext), display.
  6. Ensure that your session is authorized. If applicable, the
    icon next to your selected endpoint indicates whether an endpoint is locked. If required, authorize your session by clicking the
    , and then completing the information required in the
  7. Expand the endpoint that you want to execute, and then click
    Try it out
  8. The example values in the
    Request Body
    field become editable. Make changes to the example request, and then click