REST API Client - Testing a provided API
Tags: api, restapi, adabas
Published: 2024-07-09 12:14:11

---
title: REST API Client - Testing a provided API
published: true
date: 2024-06-14 17:41:07 UTC
tags: api, restapi, adabas
canonical_url: https://tech.forums.softwareag.com/t/rest-api-client-testing-a-provided-api/268250/1
---

 

## Introduction

This section explains how to test an API application using a Rest API client (e.g. SoapUi and Postman). In our case we will use SoapUI as Rest API client.

![Overview_components_APIClient](https://global.discourse-cdn.com/techcommunity/original/3X/1/5/15801e9c8f11ed83c41cfda048e25f00fdf3868a.png)

**The following topic modules are considered in more detail in this tutorial:**

1. Change Resource Configurations
2. Testing in SoapUI

## Change Resource Configurations

Switch to the Service Development perspective and refresh (F5 → Right click on a package and select refresh) the Package Navigator view. To customize Resource Configurations, click on the desired resource. Then you can edit Rest resources (e.g. Supported HTTP methods). To do this, select a resource from the list and click edit.

![change resource configurations](https://global.discourse-cdn.com/techcommunity/original/3X/3/3/3363abd5a4c6df218a8f309100e2393f0a1514d6.png)

Now you can specify for example which http methods should be supported.  
 ![Edit REST Resource Operation](https://global.discourse-cdn.com/techcommunity/original/3X/b/5/b547f0a495ce637da44f5b10d42d5f329ca7860b.png)

## Testing a provided API

To perform an instant test, launch SOAP UI from the Windows Start menu. Then select File and New REST Project.

[![New REST Project](https://global.discourse-cdn.com/techcommunity/original/3X/8/3/834c8ae77158857197ee7146990bf7490244d60c.png)](https://global.discourse-cdn.com/techcommunity/original/3X/8/3/834c8ae77158857197ee7146990bf7490244d60c.png "New REST Project")

Provide [http://localhost:5555/restv2/Resourcename/Programname](http://localhost:5555/restv2/Resourcename/Programname) as initial REST service URI and click OK.  
 ![provide URI](https://global.discourse-cdn.com/techcommunity/original/3X/1/d/1d795ca1d8003822c63ffeedf537b5b58915046b.png)

You can also copy the URI from the resource in the service development perspective. To do this, open the corresponding resource and look in the properties and resource configurations.  
 ![Resource properties](https://global.discourse-cdn.com/techcommunity/original/3X/c/1/c17e610b58a7fbf06e744c78e16db31fbce616a6.png)

![Resource configurations](https://global.discourse-cdn.com/techcommunity/original/3X/b/e/be48a4ce72cd0f9241d47fd8f0af40990629747e.png)

In the Navigator, now rename the generated REST project (e.g. REST Employees), the method (in our case Employees) and rename the generate request (in our case Employees).  
 ![Navigator - renaming](https://global.discourse-cdn.com/techcommunity/original/3X/c/4/c4fae1eaa50f5dc991594a37a4a52a33a922f60f.png)

Then double-click the generated request in the Navigator and provide the following parameters for the REST request:

- Mehtodtype: GET
- Request properties tab
  - Username: Administrator
  - Password: manage
- Request header
  - Request header (click on headers to add a header name): Accept
  - Request header value: application/json

**Methodtype:**  
 ![Methodtype](https://global.discourse-cdn.com/techcommunity/original/3X/d/a/dad6cb5f4c2097ac0f276e289180bf13f76d7a1c.png)

**Username + password:**  
 ![password and username](https://global.discourse-cdn.com/techcommunity/original/3X/c/e/ced426e2b6b08c8c41f7c2f6e3792198dd4b4cbf.png)

**Request header:**

1. Add HTTP Header:  
 ![add http header](https://global.discourse-cdn.com/techcommunity/original/3X/6/2/62b52c07f4b3d8f7b326321d6889ef4c78cca092.png)
2. Enter header value:  
 ![add header value](https://global.discourse-cdn.com/techcommunity/original/3X/f/c/fcd76f7f6f1ca47643f9305b03cf0f820159a57c.png)

If you have entered all the parameters just mentioned click on the green arrow ![Submit request](https://global.discourse-cdn.com/techcommunity/original/3X/4/0/409ca43c645d4eec8c7848c0dc525a21c5860a70.png) to submit the request. Open tab Raw of the response to see the HTTP response code. In case of success (200), the REST service should return a list of employees in JSON format. Therefore switch to the JSON tab of the response.

## Conclusion: Most Important Facts

- Rest API Clients: SoapUI, Postman, etc.
- The following parameters must be adjusted for the REST request before starting it
  - **Method:** GET
  - **Username:** Administrator + **Password:** manage
  - **Request Header:** Accept + **Request Header value:** application/json

With this tutorial you have successfully completed our series and have a better overview of how the various Software AG (Adabas, Natural, NaturalOne, EntireX, webMethods) products work together on the topic of API. Now you can try out the things you have learned yourself. Have fun!

[Read full topic](https://tech.forums.softwareag.com/t/rest-api-client-testing-a-provided-api/268250/1)