# API Cheatsheet

# What is an API?

An API (Application Programming Interface) serves as middleware that lets you channel data between software products.

It defines requests that have been made, handles business logic and manage data formats that should be used and the conventions to adhere when building software products

# Types of APIs

There are three main types of API, which are:

  • Private
  • Public/Partner
  • External

# Private APIs

These are APIs builts solely for use when within an organization. They are classified as an in-house application for employees to automate business processes and delivery

# Public/Partner APIs

These are APIs that are openly promoted but available for known developers or business partners. These usually represent software integration between organizations.

# External APIs

These are completely external APIs, as the name implies, which are available to any third-party developer and are mostly designed or built for end-users/customers

# Why do we need APIs?

APIs make it easier to access to a variety of resources. They also allow cross-platform communication which solves certain business logic.

# APIs are efficient

APIs hosted and created by a third-party application can significantly reduce the amount of work within your organization. This is return will speed up the development process of an application.

Companies outsource some part of the business process for a fragment of the cost to build teh same application within the organization.

# APIs make things simpler

APIs simplify complex logic by tackling different business logic in chunks. They also provide user-friendly endpoints specific to certain use cases.

An API can provide data you need without requiring extra research or manipulation which speeds up the development process.

# API Specifications

There are few different types of API specifications, which will be discussed

# Representational State Transfer (REST)

Representational State Transfer (REST) is a style of architecture that provides standards on the web between computer systems which makes communication flow easier within applications.

REST APIs are stateless and can be used for separation of concerns between the client and server.

# Service Object Access Protocol (SOAP)

According to the definition by Microsoft, SOAP is a ligtweight protocal for exchanging structured information in a decentralized, distributed environment.

This contains rules guiding requests and responses sent from web applications using XML between systems through Hypertext Transfer Protocol (HTTP)

# GraphQL

GraphQL is a query language for APIs. It provides an absolute and simplified description of the data in APIs which gives you the power to get the exact data you need. This makes it easier to evolve APIs over time and also enables powerful developer tools.

# API Testing Tools

Testing your API endpoints might be challenging after developing them, but there are some super helpful tools that will help you to test your APIs efficiently

# POSTWOMAN / HOOPSCOTCH

postwoman

A free, fast, and beautiful API request builder with an online testing environment, support for multiple platforms and multiple devices, and many more features.

# REST-Assured

REST

This tool simplifies testing API endpoints in Java. It tests and validates responses, making it seamless for Java devs to test APIs.

# PAW

PAW

Paw is a full-featured HTTP client that lets you test and describe the APIs you build or consume. It has a beautiful native macOS interface to compose requests, inspect server responses, generate client code, and export API definitions.

# POSTMAN

POSTMAN

Postman is a collaboration platform for API development. The awesome thing about this tool is that it simplifies each step of building an API and it also makes collaboration seamless for building faster APIs.

# SOAPUI

SOAPUI

This is also a testing tool that can help to make testing API endpoints seamless.

# FIRECAMP

FIRECAMP

This is a tool with friendly UI and can be used to test any stack. It doesn't matter which tech stack you use, ranging from REST API, WebSockets, GraphQL, and so on in software engineering.

# KARATE

KARATE

Karate is an open-source tool for operations like API test-automation, performance-testing, UI automation into a single, and so on.

# APIFORTRESS

APIFORTRESS

This is a great tool for testing REST, SOAP, GraphQL, Web Services, and Microservices. It also helps you automate tests as part of a CI pipeline, monitor internal APIs continuously, and so on.

# API Documentation

API Documentation is one of the most important things to consider after developing and testing your APIs. It simplifies the process of understanding what each endpoint does as well as how their requests and responses work.

Imagine you build several endpoints for user authentication. If you aren't available, but one of the frontend developers on your team wants to consume it, that could be a proble. If there is no guide or instructions explaining what each API does and there are no sample requests and responses, it can really slow down the development process.

Here are some tools you can use for APIs documentation so you don't have these issues:

Swagger

APIDocs

Postman