# API Management

## General information

API stands for "Application Programming Interface", which is an interface that enables communication between different applications, devices or software components, abstracting (i.e. hiding) the implementation layer of the functionalities, so interacting with another application is made very simple as one does not need to understand the detailed inner workings to be able to do it.

The following video illustrates this concept with a visual example:

{% embed url="https://www.youtube.com/watch?v=OVvTv9Hy91Q" %}

A standard of APIs that has established itself is called "REST", which stands for "REpresentational State Transfer". APIs that are designed according to this standard are called "RESTful APIs".

The following video explains RESTful APIs in more detail:

## RESTful APIs

{% embed url="https://www.youtube.com/watch?v=SLwpqD8n3d0" %}

Because an applications can use many different APIs, it can become complex very quickly. To have a better overview of one's APIs, one can use API documentation and management tools.

## Swagger API

Swagger is an open-source software framework that helps developers design, build, document, and consume RESTful web services. It provides a simple and clear way to describe the operations and models of an API, which can be used for both internal and external documentation.

Swagger uses a common format called OpenAPI Specification (OAS) to define the structure of an API. The specification includes information such as the API's endpoints, request and response formats, and security definitions. This information is used to automatically generate interactive documentation, client libraries, and other tools that can be used to test and consume the API.

Swagger also includes a tool called the Swagger Editor, which allows developers to design and test the API using a graphical user interface. Additionally, there's a tool called the Swagger UI, that allow to easily visualize and test the API using a web-based interface.

Swagger is widely used in the industry, many companies use it to document their API and also to generate client libraries for different programming languages.

For more information: [https://swagger.io/](https://swagger.io/)

## Installation

1. Choose your preferred programming language and framework that supports Swagger, such as Node.js, Java, or .NET.
2. Install the Swagger tools for your programming language or framework. You can find a list of Swagger-compatible tools on the Swagger website.
3. Create a new Swagger project or add Swagger to an existing project.
4. Write the Swagger definition file that describes your API. This file is usually written in YAML or JSON format and includes information such as the endpoints, methods, parameters, and response formats for your API.
5. Generate server code and client libraries from the Swagger definition file using the Swagger tools. This code can be used to implement and consume your API.
6. Test your API using the Swagger UI, which is a web-based interface that allows you to interact with your API and see its documentation in real-time.
7. Deploy your API to a production environment, such as a cloud-based service or a self-hosted server.

The specific steps for installing Swagger API will vary depending on your programming language and framework. You can find detailed installation instructions and tutorials on the Swagger website, as well as on the documentation pages for your chosen tools and frameworks.

## Video

{% embed url="https://www.youtube.com/watch?v=7MS1Z_1c5CU" %}
