-
Notifications
You must be signed in to change notification settings - Fork 23
What are APIs? How will MAC use them?
An Application Programming Interface is a set of definitions and protocols for building and integrating application software. t’s sometimes referred to as a contract between an information provider and an information user—establishing the content required from the consumer (the call) and the content required by the producer (the response). (source).
In our case, the content consumer is the front-end client, and the provider is the back-end infrastructure and databasing. This will act as the bridge between the distinct components of MAC, and provide the ability for anyone to create a front-end that is compatible with the same backend.
A RESTful API is an API that is bound by the REST architectural constraints. In order for an API to be considered RESTful, it has to conform to these criteria:
- A client-server architecture made up of clients, servers, and resources, with requests managed through HTTP.
- Stateless client-server communication, meaning no client information is stored between get requests and each request is separate and unconnected.
- Cacheable data that streamlines client-server interactions.
- A uniform interface between components so that information is transferred in a standard form. This requires that:
- resources requested are identifiable and separate from the representations sent to the client.
- resources can be manipulated by the client via the representation they receive because the representation contains enough information to do so.
- self-descriptive messages returned to the client have enough information to describe how the client should process it.
- hypertext/hypermedia is available, meaning that after accessing a resource the client should be able to use hyperlinks to find all other currently available actions they can take.
- A layered system that organizes each type of server (those responsible for security, load-balancing, etc.) involved the retrieval of requested information into hierarchies, invisible to the client.
- Code-on-demand (optional): the ability to send executable code from the server to the client when requested, extending client functionality. We will not be implementing this feature.
We will be transferring resources using JSON (Java Script Object Notation) via HTTP.