API Testing for Beginners: What and How
An API lets two programs talk to each other. When a mobile app shows your orders, it asks a server through an API and gets the data back.
What API testing checks
- The status code: 200 means OK, 201 created, 400 bad request, 401 not logged in, 404 not found, 500 server error.
- The data in the answer is correct.
- The speed is acceptable.
- Bad input is handled safely.
The common request types
GETreads data.POSTcreates data.PUTorPATCHupdates data.DELETEremoves data.
Your first request with Postman
- Install the free Postman app.
- Create a new request, choose
GETand paste a practice API address such ashttps://restful-booker.herokuapp.com/booking. - Click Send and read the status code and the body.
Why API tests are valuable
They are fast, they break less often than UI tests, and they find problems early. Many teams test the API first and the UI second.
Next step
Learn to add checks in Postman, then run them from the command line with Newman, so they can run automatically.
Want to practise this step by step?
Our free API Automation course teaches it in simple English, one day at a time.
Open the free course
Our free API Automation course teaches it in simple English, one day at a time.
Open the free course