Recursive API Calls

How to automate a web service (Rest API) that has a internal calls to other APIs?

Login API calls API 1 & API 1 returns response
Login API calls API 2 & API 2 returns some response
then Login API returns the status with the cookie

I would need more information to answer this. Are you saying there are three separate web service calls?

Are you trying to reuse your “Login API” call before each of the other calls to API 1 and 2?

Can you put logon in one test object or test case and then re-use that before calling each of the APIs?

Do you have any test objects or code to share?

Looks like you want to apply ‘chain requests’ between your used APIs. If so please refer to this guide:

Thanks for the reply. I came to know today that the login API is redirecting the calls to other APIs automatically to get the response.

SoapUI received correct response (Successful login with session id) when I try to post the login API but Katalon returned me just the login page response and not the successful login response

Hi thanks for the reply I will look into it and update… Are there any settings that I need to enable so that the request can work for API with automatic redirection?

Attaching the screenshot of the SoapUI log for the same API request

In SoapUI:
When I submit login API and it has automatically redirected to 3/4 APIs before it got the cookie / session id as the response that is as expected

In Katalon Studio:
I am getting positive response but unable to login and get the session / cookie details

Please let me know if I am missing something

I figured out a work around for now (Thanks to some old post in the community), below was the approach

  1. Used WebUI keywords to login to the application
  2. Got the ‘Cookie’ details and stored it to global variable
  3. Used the retrieved cookie in the WebService request to get the required response