Swagger "Try it out" functionality in the API Catalog
Swagger "Try it out" functionality in the API Catalog
The API Catalog enables users to call service APIs through the Try it out functionality. There are 2 types of endpoints:
-
Public endpoints
Endpoints that are accessible without entering user credentials.
-
Protected endpoints
Endpoints that are only accessible by entering user credentials. These endpoints are marked with a lock icon.
Example:
Note: Before making requests to protected endpoints, authorize your session by clicking the lock icon and complete the required information in the Authorization modal shown below:
Example:
To demonstrate Try it out, we use the example of the Swagger Petstore.
Example:
Make a request​
This section outlines the process for making a request.
Follow these steps:
-
Expand the POST Pet endpoint.
-
Click Try it out.
Example:
After you click Try it out, the example value in the Request Body field becomes editable.
-
In the Example Value field, change the first
id
value to a random value. Change the secondname
value to a value of your choice, such as the name of a pet. -
Click Execute.
Example:
The API Catalog Swagger UI submits the request and shows the curl that was submitted. The Responses section shows the response.
Example: