

This is where API acronym comes from: API is a simple interface for applications, because programs have no hands or eyes to interact with other applications! Websites and applications need the same thing in order to communicate and exchange data between each others! The menu provides you with everything you need to know (list of detailed meals) to order your preferred meal!

We use a lot of interfaces in our daily life without realizing it! Another example of an interface is the menu of a restaurant. This interface allows you to interact with your television, right? You don’t have to dive into the wires and circuits of your TV! Let’s talk a little bit about interfaces in general! A common example of an interface is the remote control of your television! The most important word here is interface! This is where RESTful APIs come into picture! REST API as a concept is defined around two aspects: REST and API! Application Programming Interfaceĭon’t let the acronym scare you! API stands for Application Programming Interface.

So, to fulfill that we need some specific standards and services to orchestrate inter-machine communication! Sharing data between two or more applications has always been a vital and essential requirement of software development! We will try to bootstrap our application using Spring Initializr! After that, we will configure MySQL database and create all the required classes and interfaces one by one.įinally, we will play around with our Spring Boot RESTful API and test some of its endpoints with Postman! Our simple application will be designed around one single domain model: Product, which encapsulates the following properties: id, name and price! In this post, we will discuss what is exactly REST API and demonstrate how to build from scratch a REST API for products managment with Spring Boot, Spring Data JPA, Lombok and MySQL! Deleting Product by ID using DELETE request:.Creating new Product using POST request:.Retrieving single Product by ID using GET request:.Retrieving all Products using GET request:.Custom annotation Create DTO to Entity mapper.
