Scroll Top

REST APIs

What is a rest api?

When you search in Google and type in “dogs” and hit enter, you will get a list of results of “dogs”.  You request “dogs” and the server responds with results of “dogs”. This is a simple way of explaining what a REST API is.

Each URL is a Request and the data sent back is called a Response.

API

Which stands for Application Programming Interface. It is rules that allow programs to communicate with each other. Developers create the APIs on the server to which the client can communicate with.

REST

Which stands for Representational State Transfer. It is rules that the developers must follow when creating APIs.

Requests

A request consists of four elements:

  • Endpoint
  • Method
  • Header
  • Data (Body)
Endpoint

Endpoints are the points of interaction between the API and the client. It is the URL that you request. The structure looks like this:

root-endpoint/?

Root-endpoint is the starting point of the API. For example, Github’s API is https://api.github.com

The path determines where the resource actually is.
So for example: https://www.incloud.jp/products/athena 

https://www.incloud.jp is the root-endpoint and /products/athena is the resource

Method

There are 5 types of requests that you can send to the server.

  • GET
  • POST
  • PUT
  • PATCH
  • DELETE

These methods are used to perform four possible request actions: Create, Read, Update, and Delete.

Method Name

Request Meaning

GET

Used to get a resource from the server. If the client performs a `GET` request, the server looks for the data that is requested and sends it back to the client. A GET request performs a READ operation. This is the default request method.

POST

Used to create a new resource on the server. If the client performs a POST request, the server creates a new entry in the database and informs if it was successful or not. A POST request performs a CREATE operation.

PUT and PATCH

Used to update a resource on the server.  A PUT or PATCH request performs an UPDATE operation.

DELETE

Used to delete a resource from the server. A DELETE request performs a DELETE operation and the server deletes an entry in the database and tells you whether the deletion is successful.

Header

Headers are used to provide information to both the client and server. It can be used for many purposes, such as authentication and providing information about the body content.

Data (Body)

The Data (Body) contains information you want to be sent to the server. This can only be used with POST, PUT, PATCH or DELETE requests.

Conclusion

This is the basic explanation of REST APIs and it means to exchange object states between a server and a client. Understanding REST APIs is essential in building a successful web application. Let InCloud develop your REST APIs correctly to allow smooth exchange of information between the cloud and your clients.

Privacy Preferences
When you visit our website, it may store information through your browser from specific services, usually in form of cookies. Here you can change your privacy preferences. Please note that blocking some types of cookies may impact your experience on our website and the services we offer.