Login API Test through rest api

How to test Login API. Plz provide me some sample also.

Hi,

please be more specific. What is “login API” and what you want to test?

Hi,

I want to test Login api or for regsitration API of any app. Please provide any sample for post request API test in rest API.
If you have any sample then please provide me. I have googled and not found enough sample on the Login/Registration API

Still not getting it. Do you want to get auth token from auth service or what?

I want to test API for Login services. I have found the youtube sample but its not match my requirement.

Please suggest some more sample by which I can create Automation API test on login/registration API.
is it clear now?

Can you share what your request should look like? Headers, body etc.,

I am new in Automation API and found few more sample guide to understand how to Automate API for Login/registration basically for put request API in katalon

Ok, let me explain you how things happen in REST API.

Login is UI action and consists of few steps.

  1. You have some login page, where you put your credentials and click log in.
  2. Your credentials are sent to auth service
  3. Auth service decides, if you are allowed to enter the protected area or not
  4. If so, it sends back auth token
  5. This token is used for all API calls inside of your protected area.

So, now please tell me, which step you want to automate.

1 Like
  1. Status code will show correct
  2. Registered fields have been enter correctly and if passed then OTP generated then verify OTP
  3. Then verify Register successfully or not
  4. After registration enter login field correctly
  5. OTP verifed
  6. Then Login Successfully
    For registration and Login there will be two different API

Did you read this article?

https://docs.katalon.com/katalon-studio/tutorials/create_rest_api_requests_manually.html

You may need to parse first response to get your OTP.and use it in second request.

This is totally manual approach. How can I use these codes using object repository and test case.Please guide on that based.

Hi, Can you please help me?

Do you want the code to be automatically generated?
I don’t think that’s possible.
you have to write your API tests manually, that’s what I do to test mine

okay if I do using manually then please suggest me how can I do the same?

1-referencing the services to be called in object repository (variabilize if necessary)
2- Write the test cases in Tests case

all documentation is available: https://docs.katalon.com/katalon-studio/tutorials/introduction_api_testing.html