API Today

 

Ronak Raithatha

API Developer @ BoomTown!

 

What is an API?

 

API - Application Program Interface

 

An API expresses a software component in terms of its operations, inputs, outputs, and underlying types.

 

API - Application Program Interface

 

An API defines functionalities that are independent of their respective implementations, which allows definitions and implementations to vary without compromising the interface.

 

API - Application Program Interface

 

A good API makes it easier to develop a program by providing all the building blocks. A programmer then puts the blocks together.

 

Working with undocumented APIs

Working with APIs without reading documentaion

 

Working with APIs you have mastered

 

IKR

 

Types of APIs

 

Language API - Java Docs  

 

Describing libraries and classes, functions in those libraries

and classes, and the parameters and return types for those functions.

2

Types of APIs

 

Library API - UnderscoreJs Docs

 

Documentation listing and describing each function in the library, the parameters it needs to perform those function and what it should return

1

Types of APIs

 

 REST API - FOAAS Docs

 

Lists and describes all accessible endpoints for a given Representational State Transfer (REST) protocol implementation. Describes verbs and what body is required with those verbs. 

1

REST Implementation

 

Endpoints

URIs that execute desired code. 

I.E Functions, but on the server. Where the function names are '/something/:id/something'

2

REST Implementation

 

VERBS

GET: Get everything about something.

POST: Added one thing to a list of somethings.

PUT: Change one existing thing in a list of somethings.

DELETE: Delete something.

2

REST Implementation

 

REQUEST BODY

If the ENDPOINTS are the function name, the REQUEST BODY are like the parameters that we send to a function.

GET: Generally none, since you get everything.

POST: An object containing necessary information

PUT: An object containing information to be updated, and an id pointing to the object to update. 

DELETE: An id to the object to delete.

Popular formats: JSON and XML

2

REST Implementation

 

Response status

2

Stack:

MongoDB

ExpressJS

AngularJS

NodeJS

 

API using Express

 

Stack: 
CoffeeScript

MongoDB

ExpressJS(LoopBack)

NodeJS

 

API using LoopBack

 

MongoDB

SQL Server

CoffeeScript

Loopback

AWS

Node.js

 

BoomTown API

 

APIs

By Ronak Raithatha