Overview of API management

Vignesh Eswaramurthy
3 min readJul 26, 2023

--

1. What is REST API?
REST API helps to communicate faster from client to servers or server to server. it transfer data from one layer to another layer of system.
REST stands for Representational State Transfer and API stands for Application Programming Interface.
Architecture flow diagram of REST API

2. HTTPS Request in REST API:

Client needs to include four things to make valid request
1. URL
2. HTTPS Method
3. List of headers
4. Body

2.1 How to create REST API URL?

The sample url structure shown in the below.

Protocol://host/basepath/method?parameter=1
https://www.youtube.com/watch?v=sdfqwerdf

While creating REST API, I would like to recommend to follow naming convention for each API. we can filter API easily as per naming in future.

We have two types of parameter:
Query parameter helps us to query/filter the list of the data.

Protocol://host/basepath/methods?parameter=1&parameter=2

Path parameter helps to point towards specific data.

Protocol://host/basepath/methods/1

2.2 List of HTTPS Methods:

There are 5 https methods availble for accessing application
GET — Ask server to read data
POST — Ask server to create/send the data
PUT — Ask server to edit/change data
DELETE — Ask server to delete data to the server
PATCH — Ask server to update the data

2.3 List of headers:

They are 4 types of headers
1. Request header
2. Response header
3. Representation header
4. Payload header

2.3.1 Request header
The client sends information to servers and server knows who is it. It’s represents by key:pair value in request header.
Example of Request header

host: www.host.com
Connection: keep-live
Authorization: Bearer token
Accept-Language: en-US
Content-Type: application/json, application/txt, application/xml
Accept-Encoding: gzip # Accept to compress data

Add some custom header based on client/server communication.

API-KEY: ase234dsfsddfsdf-23sdfsdf-3r3erewrew

2.3.2 Response header

Server responds to client along with list of headers in response. It’s represent by key:pair value in response header.
Example of Response header

Connection: keep-alive
Date: Mon, 04 Nov 2022
Server: Apache/2.6.1 (Unix) or Server: Microsoft-IIS/12.0
Content-Type: text/html
Transfer-Encoding: chunked

2.3.3 Representation header

Representation header is nothing that data is tranfered between one server to another server/client with format of sending XML, JSON, ENCODED, CHUNK formats.

Content-Type: text/html
Content-Encoding: gzip/de
Content-Length: 3523
Content-Range: bytes 50–1000/*
Content-Location: /docs/fo.xml #instructs alternate location of data

3. Response Codes

HTTPS status codes
2xx — Success
3xx — Redirection and others
4xx — Problem on client side
5xx — Problem on server side

4. API security

API security is key concept to protect backend through cyber attack. we select any one of the authentication mechanism for API to prevent data leak and cyber attack.

HTTP basic authentication
OAuth Authentication
API key Authentication
No Authentication

5. What is main difference between filtering and pagination in REST API?

Filtering
Assume there is a large amount of data in the database and I dont want to obtain all of it. I need to retrieve some specific elements from the UI layer, i.e. only the items that are important to the client. It helps in improving user experience and avoiding unnecessary data collection. The main advantage of filtering is that it reduces server load.

Pagination

The information is presented in page format. For example, it only displays 10 data on the first page, then another set of 10 data on the second page, and so on. Based on the pagesize value, we receive data from the server and display it in the UI. Pagination is always used to increase the speed of the API. In REST API, we may utilise a mix of filtering and pagination.

--

--