AllRounder.ai
Chapters in this course

Enrol to start learning

Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.

Enrol free

11.1. What is an API?

Interactive Audio Lesson

Session 1: Understanding APIs

Unlock the classroom podcast

The transcript is free to read. A free account plays the conversation back.

Sarah
SarahInstructor

Today we will learn about APIs. Can anyone tell me what an API stands for?

Noah
Noah

Is it Application Programming Interface?

Sarah
SarahInstructor

Exactly! APIs allow different software systems to communicate. Think of it like a waiter taking your order to the kitchen and bringing your food back to your table.

Isabella
Isabella

So, it’s like a middleman?

Sarah
SarahInstructor

Yes, a very important middleman! Now, when we test APIs, we often focus on REST APIs. Does anyone know what REST stands for?

Akash
Akash

I think it’s Representational State Transfer.

Sarah
SarahInstructor

Correct! REST APIs are based on certain principles which include statelessness. This means each request stands alone, without carrying context from previous requests.

Ananya
Ananya

That sounds efficient!

Sarah
SarahInstructor

Absolutely! And what are some common HTTP methods we use with REST APIs? Can someone list them?

Noah
Noah

GET, POST, PUT, DELETE!

Sarah
SarahInstructor

Well done! Remember these methods, as they are fundamental for API interactions.

Sarah
SarahInstructor

To summarize, APIs like REST allow software to interact effectively, and remembering the principles and methods is crucial.

Session 2: Postman Overview

Unlock the classroom podcast

The transcript is free to read. A free account plays the conversation back.

Robert
RobertInstructor

Now let's move to Postman. What do you think Postman is used for?

Isabella
Isabella

Is it a tool for sending requests to APIs?

Robert
RobertInstructor

Yes! Postman allows you to send various types of HTTP requests. Can you name one part of the Postman interface?

Akash
Akash

The Request Builder?

Robert
RobertInstructor

Correct! In the Request Builder, you can select the HTTP method and enter the API URL. What do you think comes after that?

Ananya
Ananya

Do you add headers or parameters next?

Robert
RobertInstructor

Exactly! You can set headers in the Headers tab and add parameters too. Let me give you an example: If we want to create a user, we use POST and provide the user details in the Body.

Noah
Noah

And we see the response in the Response Viewer, right?

Robert
RobertInstructor

Yes! And learning how to validate responses using assertions is key. To recap, Postman simplifies API testing by offering a user-friendly interface and validation tools.

Session 3: API Testing Workflow

Unlock the classroom podcast

The transcript is free to read. A free account plays the conversation back.

Sarah
SarahInstructor

Let's dive deeper into the API testing workflow. When you send a GET request in Postman, what do you expect from the API?

Isabella
Isabella

We should get a list of users in the response.

Sarah
SarahInstructor

Right! For example, if we request a URL like https://api.example.com/users, we may receive user data in JSON format. What’s important to check in that response?

Akash
Akash

We should check that the fields like 'id' and 'name' are correct.

Sarah
SarahInstructor

Yes, and with Postman, you can automate this check using assertions in the Tests tab. Can someone write an example of how to check for a status code?

Ananya
Ananya

You can use pm.response.to.have.status(200) to check if the status is 200.

Sarah
SarahInstructor

Exactly! Checking the response is crucial in ensuring that APIs work as intended. In summary, sending requests and validating responses with Postman is a key process for API testing.