12

Poli 2.0 - APIs

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Poli 2.0 - APIs
Page 2: Poli 2.0 - APIs

APIs

Page 3: Poli 2.0 - APIs

“An application programming interface (API)  is  a  set  of functions, procedures,

methods or classes that an operating system, library or service provides tosupport requests made by computer programs.[1] ”

“ Web services are frequently just Web APIs that can be accessed over anetwork, such as the Internet, and executed on a remote system hosting therequested services. ”

Page 4: Poli 2.0 - APIs

Resources — Commands are defined in simple terms: resources  to be retrieved, stored / get, set

Nouns — Exchanging resources and concepts

Commands — Commands are defined in methods with varying complexity: depending on “standard” 

Verbs — Exchanging methods

RPC vs. REST

Page 5: Poli 2.0 - APIs

RPC vs. REST

http://example.com/users/http://example.com/users/{user}http://example.com/findUserFormhttp://example.com/locations/http://example.com/locations/{location} http://example.com/findLocationForm ...

getUser() addUser()removeUser()updateUser()getLocation()addLocation()removeLocation()updateLocation()listUsers()listLocations()findLocation()findUser() ...

Page 6: Poli 2.0 - APIs

Most web services use RESTful APIs!

...or at least “accidently RESTful”

Page 7: Poli 2.0 - APIs

RSSAtomPHP...

JSONjsonFlickrApi({ "stat": "ok",

"blogs": { "blog": [ { "id" : "73", "name" : "Bloxus test", "needspassword" : "0", "url" : "http://remote.bloxus.com/" }, ] } })

XML<blogs> <blog id="73" name="Bloxus test" needspassword="0" url="http://remote.bloxus.com/" /> </blogs>

Page 8: Poli 2.0 - APIs

Mashup!

Page 9: Poli 2.0 - APIs

http://api.uberVU.com

• ubervu.test.echo• ubervu.conversations.track• ubervu.conversations.getList• ubervu.conversations.getReactions

Page 10: Poli 2.0 - APIs

Case Study

http://code.uberVU.com/ureactWordPress Plugin

Page 11: Poli 2.0 - APIs

Exercise!          Widget

Page 12: Poli 2.0 - APIs