Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
API Testing and Development with Postman
API Testing and Development with Postman

API Testing and Development with Postman: API creation, testing, debugging, and management made easy , Second Edition

eBook
$9.99 $39.99
Paperback
$49.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

API Testing and Development with Postman

API Testing and Development with Postman, Second Edition: API creation, testing, debugging, and management made easy

Welcome to Packt Early Access. We’re giving you an exclusive preview of this book before it goes on sale. It can take many months to write a book, but our authors have cutting-edge information to share with you today. Early Access gives you an insight into the latest developments by making chapter drafts available. The chapters may be a little rough around the edges right now, but our authors will update them over time.You can dip in and out of this book or follow along from start to finish; Early Access is designed to be flexible. We hope you enjoy getting to know more about the process of writing a Packt book.

  1. Chapter 1: API Terminology and Types
  2. Chapter 2: Principles of API Design
  3. Chapter 3: OpenAPI and API Specifications
  4. Chapter 4: Considerations for Good API Test Automation
  5. Chapter 5: Understanding Authorization Options
  6. Chapter 6...

What is an API?

A 1969 NASA publication entitled Computer Program Abstracts contains a summary of a real-time display control program sold by IBM (only $310! Plus $36 if you want the documentation). The advertisement says that this program was designed as an operator-application programming interface – in other words, an API.

Application Programming Interfaces (APIs) have been around for about as long as computer code has. Conceptually, it is just a way for two different pieces of code (or a human and some code) to interface with each other. A class that provides certain public methods that other code can call has an API. A script that accepts certain kinds of input has an API. A driver on your computer that requires programs to call it in a certain way has an API.

However, as the internet grew, the term API narrowed in focus. Almost always now, when someone talks about an API, they are talking about a web API. That is the context I will use in this book. A web API...

Types of API calls

Some calls to APIs can change things on the server, while others return data without changing anything. The terms safe and idempotent are used to describe the different ways that API calls can affect data. These terms might sound a bit intimidating, so in order to better understand them, let’s look at an illustration that uses something we can all understand: LEGO pieces.

Imagine that there is a table with a couple of LEGO pieces on it and I’m sitting by the table. I represent an API, while the table represents a server, and the LEGO pieces represent objects. If you come along and want to interact with the LEGO, you must do so through me. In this illustration, the LEGO pieces represent objects on a server, I represent an API, and you represent a client. In picture form, it looks something like this:

Figure 1.1: Representation of a server and a client connected by an API

You are going to be the client in this imaginary relationship...

Installing Postman

Postman can be run on the web or as a desktop application. The functionality and design are similar between the web and desktop applications, but in this book, I will mostly use the desktop application, so I would recommend you install it too. The app is available for Windows, Mac, and Linux, and installing it is the same as pretty much any other program you’ve installed. However, I would highly recommend creating a Postman account if you don’t already have one. Creating an account is totally free, and it makes it a lot easier to manage and share your work. The free account of Postman is very generous in what functionality it enables. Postman does have some enterprise or advanced-level features that require a paid account, but all the examples in this book will work with the free features of Postman. However, if you don’t have an account at all, it will be difficult to follow along with some of the examples, so I would strongly recommend that...

The structure of an API request

The request tab in Postman provides a lot of information about the various pieces that make up an API request. Each of these pieces plays an important part in sending and receiving data with an API, so I will walk you through each one in turn. Some parts of an API request are optional, depending on what kind of request it is and what you are trying to do with it, but there are three pieces that are required for every API request. Every API request needs an endpoint, headers, and an action; let’s look at those next.

API endpoints

Every web-based API request must specify an endpoint. In the Postman requests tab, you are prompted to enter the request URL. Postman asks you to enter a URL because an API endpoint is just a URL. We use the term URL so much that we can sometimes forget what it stands for. URL is an acronym for Uniform Resource Locator. The endpoint of an API call specifies the resource, or the “R” of the URL. In...

Learning by doing – making API calls

Books are a great way to grow and learn. You are reading this book, so I don’t think I need to convince you of that! However, reading a book (or even three or four books) on a topic does not mean you understand that topic. There is theory and then there is putting it into practice. These are two very different things, and if all you do is read about a topic, you will feel like you know that topic, but that will be more of a feeling than a reality.

If you want that to be a reality and you don’t just want this book to be another piece of theoretical knowledge bouncing around inside your head, you need to put into practice the things that you are learning.

Hands-on exercises might feel like they are slowing down your reading, but working through them will actually help you learn faster and get more out of this book. But enough talking about it. Let’s get to some exercises!

In order to help you with getting...

Considerations for API testing

We have started with the mechanics of how to make API requests, but this book is about API testing, so now that you know some of the basics of how an API request works, let’s look at some of the things to consider when you test an API. One important aspect of testing is exploratory testing.

Beginning with exploration

I can still clearly remember the first time I saw a modern web API in action. The company I was working at was building a centralized reporting platform for all the automated tests, and I was assigned to help test the reporting platform. One of the key aspects of this platform was the ability to read and manipulate data through a web API. As I started testing this system, I quickly realized how powerful this paradigm was.

Another part of my job at that time was to work with a custom-built test automation system. This system was quite different from the more standard test automation framework that many others in the company...

Different types of APIs

There are several types of APIs commonly used on the internet. Before you dive too deep into the details of using Postman, it is worth knowing a bit about the different kinds of APIs and how to recognize and test them. In the following sections, I will provide brief explanations of the three most common types of APIs that you will see on the internet.

REST APIs

We’ll start with what is probably the most common type of API you’ll come across on the modern web, the RESTful API. REST stands for Representational State Transfer and refers to an architectural style that guides you in terms of how you should create APIs. I won’t go into the details of the properties that a RESTful API should have (you can look them up on Wikipedia if you want, at https://en.wikipedia.org/wiki/Representational_state_transfer), but there are a few clues that can let you know that you are probably testing a RESTful API.

Since RESTful APIs are based on...

Summary

Let’s pause for a minute to consider everything we have gone over in this chapter. You’ve installed Postman and already made several API requests. You’ve learned how API requests work and how to call them. I explained some basic testing considerations and gave you strategies that you can start to use right away in your day-to-day work. You also got to make calls to GraphQL, SOAP, and REST APIs and learned a ton of API terminology.

You now have something firm to hold onto as we proceed through the rest of this book. I will take you deep into a lot of API testing and design topics and help you get the most out of Postman, but in order to get the most out of it and not feel frustrated, it would be good to make sure you understand the topics covered in this chapter.

Take a minute to ask yourself the following questions:

  • Would I feel comfortable reading an article on API testing? Could I follow along with the terminology used?
  • What...
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Learn the tenets of effective API testing and design with workflow testing and more
  • Gain an in-depth understanding of Postman’s new and existing features, including Mock Servers
  • Know when and how to use Postman to create high-quality APIs for software and web apps

Description

Postman is an invaluable tool for exploration and testing of web APIs and helping testers and developers figure out how an API works. With Postman, you can create effective test automation for any APIs, and this guide will help you unleash its full potential. API Testing and Development with Postman is an invaluable resource for anyone who wants to create a good quality API, but isn't sure how to go about it. This guide will help you unleash the full potential of Postman’s test automation capabilities. A combination of theory coupled with real-world examples will help you learn how to use Postman to create well-designed, documented, and tested APIs. After you’ve familiarized yourself with the theory, you’ll move on to hands-on projects that will teach you how to add test automation to an existing API. You’ll also learn some of the new and powerful features that Postman has that can help you avoid introducing bugs. This second, fully updated edition features new chapters on workflow testing, creating and using mock servers, API security testing, and performance testing. The new and expanded information in this edition will help you future-proof your APIs. By the end of this book, you'll be able to use Postman to set up and run API tests for any API that you are working with.

Who is this book for?

The book is for software testing professionals and software developers looking to improve product and API quality through API test automation. You’ll also find this book useful if you have a basic understanding of APIs and want to build your skills for creating, testing, and documenting them. The book assumes beginner-level knowledge of JavaScript and API development.

What you will learn

  • Find out what is involved in effective API testing
  • Leverage Postman to improve the quality of you API
  • Use data-driven testing in Postman to create scalable API tests
  • How to create and use a Mock Server in Postman
  • Verify and improve the quality of an API using contract testing
  • Understand the basic principles of security testing
  • Get to grips with functional and non-functional testing of an API
  • Discover how to use industry standards such as OpenAPI and mocking

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 24, 2024
Length: 358 pages
Edition : 2nd
Language : English
ISBN-13 : 9781804616000
Vendor :
Google
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jun 24, 2024
Length: 358 pages
Edition : 2nd
Language : English
ISBN-13 : 9781804616000
Vendor :
Google
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 151.97
API Testing and Development with Postman
$49.99
Mastering Node.js Web Development
$49.99
Elastic Stack 8.x Cookbook
$51.99
Total $ 151.97 Stars icon
Banner background image

Table of Contents

17 Chapters
API Terminology and Types Chevron down icon Chevron up icon
API Documentation and Design Chevron down icon Chevron up icon
OpenAPI and API Specifications Chevron down icon Chevron up icon
Considerations for Good API Test Automation Chevron down icon Chevron up icon
Understanding Authorization Options Chevron down icon Chevron up icon
Creating Test Validation Scripts Chevron down icon Chevron up icon
Data-Driven Testing Chevron down icon Chevron up icon
Workflow Testing Chevron down icon Chevron up icon
Running API Tests in CI with Newman Chevron down icon Chevron up icon
Monitoring APIs with Postman Chevron down icon Chevron up icon
Testing an Existing API Chevron down icon Chevron up icon
Creating and Using Mock Servers in Postman Chevron down icon Chevron up icon
Using Contract Testing to Verify an API Chevron down icon Chevron up icon
API Security Testing Chevron down icon Chevron up icon
Performance Testing an API Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9
(8 Ratings)
5 star 87.5%
4 star 12.5%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Giuseppe Nov 09, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Excellent explanations
Subscriber review Packt
Andres Apr 18, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great contents, very well presented, good job!!
Subscriber review Packt
Allen Wyma Jun 24, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I've been using Postman for sometime and wanted to learn more about how it works. This book was a fantastic resource and I've since upped my game in using Postman thanks to this book!
Amazon Verified review Amazon
A. Zubarev Sep 11, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
These days, APIs are ubiquitous, nevertheless, it is still difficult to discover their usage, capabilities and test them without a specialized tool.For many in the IT industry, it is hard to think of a more proliferated tool for the APIs testing and exploration than Postman.So why not to leverage it to its full potential and rip maximum benefits?This book is focused exactly on this.For myself, a daily user of Postman, many areas of remained obscure and hardly visited.This book broke into these areas guiding gently and affirmatively toward various useful goals of an IT practitioner (be it a developer or QA analyst).I liked how the author sets the stage in the book so it becomes easy for even a novice to approach APIs.The most useful parts of this book for me were on creating mocks, test automation and integration with CI.What remained uncovered, but I wished was fleshed out are the paid parts as working in teams (e.g. collaboration), cloud integration, flows, etc.Still a solid five.Fasten your belt and become more efficient and productive testing and developing APIs!
Amazon Verified review Amazon
Abhishek Kumar Jun 24, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Read the early release copy of this book. It was a great read and covered all concepts of API dev and testing using postman. Especially the part related to testing was practical and insighful. Highly recommended
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.