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.
Fig. 3.195 Test REST APIs¶
On the Test page, enter the required parameters necessary to test the API.
Fig. 3.196 Test¶
From the method drop-down, select the required method for the API call.
Fig. 3.197 Select Method¶
In the Select request URL field, enter the API endpoint.
Fig. 3.198 Select request URL¶
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.
Fig. 3.199 Request Headers¶
Under the Request Body, enter the request body, if present.
Fig. 3.200 Request Body¶
Click Send. The response from the Gateway will be displayed under the Response Headers and Response Body.
Fig. 3.201 Response Headers¶
Fig. 3.202 Response Body¶
To test a SOAP API:
Navigate to the API Configuration screen of a published API and click Test.
Fig. 3.203 Test SOAP APIs¶
On the Test page, enter the required parameters necessary to test the API.
Fig. 3.204 Test¶
From the method drop-down, select the required method for the API call.
Fig. 3.205 Select Method¶
In the Select request URL field, enter the API endpoint.
Fig. 3.206 Select request URL¶
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.
Fig. 3.207 Request Headers¶
Under the Request Body, enter the request body, if present.
Fig. 3.208 Request Body¶
Click Send. The response from the Gateway will be displayed under the Response Headers and Response Body.
Fig. 3.209 Response Headers¶
Fig. 3.210 Response Body¶