API Manager Guide > API management > Interactively testing a managed API
  

Interactively testing a managed API

You can interactively test a managed API created for a REST API in a Swagger interface. You can view the API URL, the HTTP status codes, the request parameters, and the response parameters. You can also execute the API for testing purposes, or get a sample cURL command.
    1In the API Registry page, click to select a managed API, or click to open the Actions menu and select View API Details.
    The API details window appears.
    2Select the Swagger tab.
    3If the managed API requires authentication, the Authorization dialog box appears. You might need to perform one of the following actions based on the authentication type that the managed API uses:
    4To expand the view in the Swagger tab, click the arrows in the upper right corner.
    5To view the API request body and response codes, click any button that displays an API method.
    For example, for an API with a POST method, a POST button is displayed. Click the POST button to view the API request body and response code. The input fields are displayed in the request body and the output fields are displayed in the response body with the data types and field descriptions.
    6To view the request body in JSON format, select application/json. To view the request body in XML format, select application/xml.
    7To test the API semantics, in the request body panel, perform the following steps:
    1. aClick Try it out.
    2. bEdit the request body. Replace any parameter type with a value.
    3. Note: If a query parameter in a managed API URL includes spaces, the access request fails. Use POST to pass a query parameter that includes spaces.
    4. cTo test the updated request body, click Execute.
    5. The Server response panel displays the response body, response headers, and request duration time.
    6. dTo clear the server response, click Clear.
    7. eTo cancel the request body changes, click Cancel. To change the request body again, click Edit.
    8To view the request or response syntax, in the Models panel, click the right arrow near the request or response entry.
    The model request or response body is displayed. A red asterisk next to an element indicates a required element. The input fields are displayed in the request body and the output fields are displayed in the response body with the data types and field descriptions.