3.6. Test an API¶
Once users are done designing and publishing APIs, they need to test the APIs for functionality. DigitMarket™ API Manager’s Test feature is a simple and interactive interface that allows users to compose and send requests, and view responses to those requests. In short, it allows users to test the functionality of their APIs, without having to write a single line of code. This feature enables users to easily validate the responses of their API calls from within the DigitMarket™ API Manager application, instead of having to use any third-party application to do the same.
In DigitMarket™ API Manager, users can test their APIs by invoking the following methods:
GET: Allows users to obtain information
POST: Allows users to add new information
PUT: Allows users to replace exiting information
PATCH: Allows users to update certain exiting information
DELETE: Allows users to delete exiting information
OPTIONS: Allows users to request for information about the communication option available for a resource
Note
Test feature is only available for published REST/SOAP APIs.
To test a REST API:
Navigate to the REST API Configuration screen of a published API and click Test.
On the Test page, enter the required parameters necessary to test the API.
From the method drop-down, select the required method for the API call.
In the Select request URL field, enter the API endpoint.
Under Request Headers, click the toggle button to enable Key and Value fields to enter the mandatory headers. You can enter more than one header.
Under the Request Body, enter the request body, if present.
Click Send. The response from the Gateway will be displayed under the Response Headers and Response Body.
To test a SOAP API:
Navigate to the API Configuration screen of a published API and click Test.
On the Test page, enter the required parameters necessary to test the API.
From the method drop-down, select the required method for the API call.
In the Select request URL field, enter the API endpoint.
Under Request Headers, click the toggle button to enable Key and Value fields to enter the mandatory headers. You can enter more than one header.
Under the Request Body, enter the request body, if present.
Click Send. The response from the Gateway will be displayed under the Response Headers and Response Body.