API Testing

API facilitates the communication and exchange of data among different systems and is written and developed in advance for a modular software development approach. It is an application or system that can be used to implement a programming interface that is written using functions or sub-routines and can be used by other software.

API Testing mostly focuses on the business logic layer (as defined in the diagram) of software development architecture.

API testing does not connect with the look and feel of the software product. As an alternative to using standard input devices (like a keyboard) or output devices (like a monitor), API testing uses software for sending calls to your API that you'll use during API test to fetch output and eventually document the response of your product.

Below is an example of an API test where JSON input is mentioned, which is used to call the Login API.

Request Body (JSON):
{
  "Username": "devma@example.com",
  "Password": "securepassword"
}

While testing the API, the tester examines the input and expected output according to the technical document.

Sample Response - Success:
{
  "ResponseCode": 200,
  "Message": "Success",
  "Data": {
    "UserGUID": "46cba3f2-3cd0-4bca-19d6-208753741c5",
    "FirstName": "Dev",
    "LastName": "",
    "SessionKey": "3f67f981-387a-0850-1e21-42ee6bc4db08"
  }
}
Sample Response - Error:
{
  "ResponseCode": 500,
  "Message": "Invalid login credentials",
  "Data": []
}

Scroll Back to Top