API Gateway 10.15 | Getting Started with API Gateway | Create your first REST API | Testing a REST API
 
Testing a REST API
You can test a REST API by invoking the REST API URI in postman. Specify the REST API URI with the required method in the format as follows:
API format
You can customize or shorten the base path of the REST API URI by creating URL aliases. To know more about how to create URL aliases, see [URL aliases](/apigateway/10.15.0/administration/chapter1b/#co-gtw_configure_url_aliases).
Let's test the SearchCruise REST API, which was imported using a file. In this example, to test whether the Search Cruise API is created successfully, let's search a cruise with cruise ID 00001 using the Search Cruise API. The API response should include the details of the requested cruise.
*To test a REST API using Postman
1. In the Postman UI, select the http method as GET as the search is performed using the cruise ID.
2. Invoke the endpoint, http://host_name/gateway/SearchCruise/10.2/cruises/{CrusieID}.
test API
3. In the Authorization tab, select the type as Basic Auth and provide the login credentials of the API Gateway instance.
4. Click Send.
The REST API is invoked successfully and returns the status code as 200. Also, the response contains the details of the Cruise. You can now expose the API to the consumers.
For details about the further actions you can perform on the API, see All about APIs in the API Gateway User's Guide.