All Lessons

All Lessons

Atlantis REST API Architecture

@lantis API Defined

An application programming interface or API is a way for two computers to talk to each other.

@lantis APIs (@APIs) are all “RESTFUL,” which means they follow a set of rules or constraints known as “Representational State Transfer,” which has been the de facto standard for API development for a while.

RESTFUL APIs organize data entities or resources into a bunch of unique URIs.

A member can get content by making a request to that endpoint over HTTP.

The request message has a very specific format.

Most importantly, the start line contains the URI that you wish to access, followed by an HGTP verb or request method, which signals your intent with the resource.

A get request means you just want to read the data, while a post means you want to create a new resource patch for updates.

Delete is for removing data along with a few other methods beyond those.

Below the start line, we have headers that contain metadata about the request.

The accept header can tell the server you want the data in a specific format, or the authorization header can be used to tell the server that you’re actually allowed to make that request.

Then, following the headers, we have the body, which contains content.

The “Library” will receive the request message and then execute some code, usually to read from a database that can then be formatted into a response message.

All response messages will have two elements: Metadata and Content.

An important part of RESTFUL API architecture is that it’s stateless, which means that the two parties don’t need to store any information about each other, and every request-response cycle is independent of all other communication, and this leads to well-behaved web applications that are predictable and reliable.