Test a REST API¶
Testing APIs refers to the process of trying out the APIs in the Publisher itself to make sure that the APIs meet the required functionalities and behavior.
WSO2 API Manager's Publisher offers an integrated API Console that allows API creators and API publishers to visualize the API contract and interact with API's resources.
Follow the instructions below to use the Publisher test console to test an API:
PizzaShack REST API or an API of your choice before following the instructions below. For more information, see Create a REST API.
Sign in to the Publisher.
For testing purposes, you can use
adminas the username and password.
The list of APIs that are available in the Publisher appear.
Click on the API that you wish to test.
Let's use the sample
Go to Test and click TryOut.
- The API can be tested in any lifecycle state, and can be used in any state except for the "retired" state, even in the "block" state you can still try it out, but you will get a 503 (service unavailable) response.
You can generate the internal key by clicking on the Generate Key button to invoke and test the PizzaShack API.
- The UI generates an Internal token to authenticate the API call.
- If the API Publishers have a token or key then they can paste it in the UI and invoke the API using that key
Expand the GET method, click Try it out, and click Execute.
Note the successful response for the API invocation.