Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 30 ยท Getting Started

Types of APIs and API testing tools compared

Learn the API styles (REST, SOAP, GraphQL, gRPC), the public, partner, private and composite access models, common restrictions, and how Postman compares with other testing tools.

"API" covers a lot of ground. A weather widget calls a public REST API, a bank talks to a payment network over SOAP, a mobile app queries a GraphQL gateway, and two internal services stream data over gRPC. Each style has its own rules, and each affects how you test it. This lesson sorts APIs along two axes (the architecture style and who may use it), lists the typical limits you will meet, and compares the tools used to test them, so you know when Postman is the right choice and when it is not.

You already know the basics from What is API testing? and HTTP and REST in ten minutes. Here we widen the view.

What happens on a call

Every API call follows the same story, whatever the style. The client builds a request and sends it to an endpoint. The API receives and validates it (is the caller known, is the input well formed?). The API then talks to the back end: a database, another service, a file or a queue. Finally it assembles a response and returns it with a status. A tester checks each stage from outside: wrong credentials must be refused at stage one, bad data at stage two, and failures at stage three must come back as clean errors rather than stack traces.

Architecture styles

Style Message format Shape Typical strength Testing note
REST JSON, sometimes XML Resources and HTTP verbs Simple, cacheable, everywhere Plain HTTP checks in Postman
SOAP XML envelope, WSDL contract Operations on one endpoint Strict contracts, WS-Security Send XML, validate against the WSDL
GraphQL JSON, one query language One endpoint, client picks fields No over- or under-fetching Test queries, variables and error arrays (see Testing GraphQL, WebSocket and gRPC)
gRPC Protocol Buffers over HTTP/2 Typed methods generated from .proto Speed, streaming Needs the .proto file and a gRPC-aware client
WebSocket Frames over a long-lived connection Bidirectional messages Live updates Connect, send, assert on received messages
Webhooks HTTP callback to your URL Server calls you Event notification Test with a request catcher or mock

REST is by far the most common, but status codes alone do not define it. Many "REST" APIs break its rules (verbs in URLs, always returning 200). As a tester, check what the API actually does and what its documentation promises, not the label.

A short note on RPC style: SOAP and gRPC are remote procedure call styles. You call an action (GetOrder, CreateInvoice) rather than fetch a resource, so the tests read like function calls with arguments and return values.

Who can use it: access models

Model Audience Examples of expectations
Open or public Any developer, often with a free key Rate limits, clear documentation, backward compatibility
Partner Selected business partners under agreement Credentials per partner, contract and SLA, stricter versioning
Private or internal Your own teams Faster change, still needs contracts between teams
Composite Combines several calls behind one endpoint Failure of one inner call must not leave data half written

A composite API deserves special tests. When one request calls three services (reserve stock, charge card, create shipment), you must test what happens when the second one fails: is the stock released? Is the customer charged twice if the client retries? These partial-failure paths are where defects hide.

Typical restrictions you must test

APIs limit what callers may do, and every limit is testable.

  • Authentication requirements. Missing, invalid and expired credentials each give 401. See Authentication.
  • Access permissions. A valid user without the right role gets 403; a user must not read another user's data.
  • Usage quotas and rate limits. After N calls per window you get 429, often with a Retry-After header.
  • Version restrictions. /v1 is frozen, /v2 adds fields; deprecated versions may return a warning header or stop working on a date.
  • Payload limits. Maximum body size, page size, upload types.

Typical uses show the variety: connecting a CRM, embedding maps, fetching weather, posting to social networks, taking payments. The test ideas stay the same.

Choosing a testing tool

No tool is best for everything. Match it to the job:

Tool Kind Good for Limits
Postman GUI plus scripting, CLI (Newman) Exploring, functional tests, collections, team sharing, CI Not built for very large load tests
Insomnia GUI client Lightweight exploring, GraphQL, gRPC Smaller testing and reporting features
Bruno Git-friendly client storing requests as plain files Teams that want requests in the repository Younger ecosystem
SoapUI GUI for SOAP and REST Heavy SOAP and WSDL work, data-driven functional tests Dated interface, Java based
REST Assured Java library Developers writing API tests in JUnit Needs code, no GUI
Apache JMeter Load testing tool Performance and load, many protocols Steeper learning curve for functional tests
k6 Load testing in JavaScript Scripted load tests in CI No GUI for exploration
curl or HTTPie Command line Quick checks, scripts No test framework

A common team setup is Postman or Bruno for exploration and functional tests, a code-based library inside the developers' test suite, and k6 or JMeter for load. The skills transfer: a request is a request, and assertions look similar everywhere.

A stand-in that helps choose

The helper below scores tools against the needs of a project. It is a thinking aid, not a recommendation engine; change the needs and the weights to match your situation.

JS Which tool fits which need?

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Testing different API styles with the same ideas

Whatever the style, build the same four checks:

  1. Contract. Does the response have the documented shape? (See Contract testing and OpenAPI.)
  2. Behavior. Do the business rules hold for valid and invalid input? (See Software testing types and design techniques for APIs.)
  3. Security. Are authentication and authorization enforced? (See Security testing basics for APIs.)
  4. Non-functional. Is it fast enough, and does it limit abuse?

The following stand-in classifies a handful of API descriptions by style and access, to practice recognizing them from their traits.

JS Recognize the API style from its traits

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which API style uses a single endpoint where the client chooses exactly which fields to receive?

    GraphQL exposes one endpoint and lets the client describe the shape of the response.
  2. 2. A checkout call reserves stock, charges a card and creates a shipment. What kind of API call is this, and what must you test especially?

    Composite calls combine several services, so partial failures (stock reserved, payment failed) are the riskiest paths.
  3. 3. A valid user without the right role calls an admin endpoint. Which response is expected?

    401 means the caller is not authenticated; 403 means authenticated but not allowed.
  4. 4. Which tool is designed mainly for load and performance testing?

    JMeter and k6 are built for generating large amounts of traffic; Postman is mainly for functional testing.

Summary

  • Every API call is received, validated, processed against a back end and answered; tests cover each stage.
  • Styles include REST, SOAP, GraphQL, gRPC, WebSocket and webhooks; the label does not guarantee the behavior, so test what it does.
  • Access models are public, partner, private and composite; composite calls need partial-failure tests.
  • Restrictions such as authentication, permissions, quotas, versions and payload limits are all testable.
  • Choose tools by job: Postman or Bruno for functional work, code libraries for developer tests, k6 or JMeter for load.

Next: Installing Postman and a tour of the interface.