API Application Program Interface Sophia Pandey Ryan Amundson
















- Slides: 16

API (Application Program Interface) Sophia Pandey, Ryan Amundson, & Jessica Betts

Outline What is an API? / Who uses API’s? API Pros and Cons Security Concerns 3 rd Party Authentication JSON RESTful API

What is an API? Application Programming Interface A way for programmers to communicate with an application

Who uses API’s?

Most Popular APIs 1. Facebook 2. Google Maps 3. Twitter 4. Youtube 5. Accu. Weather

API Pros and Cons Pros: Cons: -less work for developers -user convenience dependency -site capabilities -security -

Security Concerns Problem arises with how API’s are coded Not the concept Review code prior to release Security expert Test on multiple platforms and browsers Developers - include how to guide in documentation

API’s - 3 rd Party Authentication Redirection occurs Facebook Example Commonly use OAuth protocol Focuses on client developer simplicity Provides specific authorization

JSON/XML Java. Script Object Notation Object for efficiently storing and moving data Uses objects and arrays to nest information Readability Extensible Markup Language Uses tags similar to HTML Nests data between tags

RESTful API What is REST? - REpresentational State Transfer Why should I use it? Simplicity of interfaces(Client-Server, Uniform) Stateless Modifiability of components to meet changing needs ( (even while the application is running) Visibility of communication between components by service agents (Middleware) Portability of components by moving program code with the data Reliability at the system level(Modular, Resilient)

HTTP Requests - CRUD for API’s - GET - Retrieve a resource - POST - Create a resource - PUT - Update a resource /. . . www m ple. co m a x e. {Controller}/{Action}/{ID}

Routing URL pattern mapped to a handler Server side handling of API request Receives incoming http request Middleware evaluates request Route determines resources to manipulate

Status Codes - 1 xx: informational - 2 xx: Success - 3 xx: Redirection - 4 xx: Client Error - 5 xx: Server Error

Tools + Examples Postman API testing tool Oxford University Google Geocode: maps. googleapis. com/maps/api/geocode/json? address=Oxford%20 University, %20 uk&sensor=false Beyonce Itunes search API: itunes. apple. com/search? term=beyonce&entity=music. Video Go to: ryanamundson. com: 8000

Mashup Combination of many APIs used together to create a new application E. g. google maps and photo locations Enterprise mashups Companies resources combined with external sources Consumer mashups wikipediavision(shows where edits are from with google maps)

Mashups Popular Mashups: - Infogr. am - Google charts, maps and analytics - vine. OS - Google analytics, UPS, Pay. Pal and more - E-commerce