What is API | Bondar Academy
Course: AI-based testing with testRigor
Module: Working with APIs
Instructor: Artem Bondar
Lesson Summary
In this lesson, we explore how to use Test Trigger to interact with APIs, including direct interactions and mocking APIs for improved testing. This is particularly useful for testing edge cases and scenarios. What is an API? API stands for Application Programming Interface . It acts as a black box that you can interact with through API endpoints . For example, a weather API has two endpoints: GET endpoint for Dallas temperature POST endpoint for city temperature When you send a request to the GET endpoint, you receive a response in the form of a JSON object containing the current temperature. Types of API Requests GET : Retrieve specific data POST : Send data to create a resource PUT : Update an existing resource DELETE : Remove a resource HTTP Response Status Codes Understanding status codes is crucial: 200 : Success 300 : Redirection 400 : Client error (e.g., 404 for not found) 500 : Server error Using Test Trigger Test Trigger can: Mock APIs to simulate responses for testing Make direct API calls for efficient testing For example, to delete a user, you can create the user via an API call instead of through the application interface, speeding up the testing process. In summary, APIs are essential for application interaction, and Test Trigger provides powerful tools for testing API functionalities effectively.