api all the things!

31
API All the Things! OpenWest 2015 David Stockton

Upload: david-stockton

Post on 17-Jul-2015

100 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: API All the Things!

API All the Things!OpenWest 2015

David Stockton

Page 2: API All the Things!

Who Am I?• David Stockton

• VP of Technology, i3logix (Denver, CO)

• Developing PHP for ~17 years

• @dstockto

• http://davidstockton.com

• http://tddftw.com

Page 3: API All the Things!

• USB Drives contain an empty Apigility project

• Copy the apigility directory to your computer. You need PHP 5.4.8 or greater on your computer or a VM.

• Pass the drives on to the next person when copying is done

• Please return them to me when everyone has a copy

Page 4: API All the Things!

Other Software• REST tester

• DHC in chrome

• POSTman

• Advanced Rest Client

• PAW

• Httpie

• Curl

Page 5: API All the Things!

Why build APIs?

Page 6: API All the Things!

Why not build APIs?

Page 7: API All the Things!

Content Negotiation

Page 8: API All the Things!

HTTP Method Negotiation

Page 9: API All the Things!

Versioning

Page 10: API All the Things!

Validation

Page 11: API All the Things!

Authentication

Page 12: API All the Things!

Authorization

Page 13: API All the Things!

Documentation

Page 14: API All the Things!

Discovery

Page 15: API All the Things!

What can we do?

Page 16: API All the Things!
Page 17: API All the Things!

Apigility is opinionated

Page 18: API All the Things!

Content NegotiationJSON / JSON+HAL

Page 19: API All the Things!

HTTP Method Negotiation

GET, POST, PUT, PATCH, DELETE, OPTIONS

Page 20: API All the Things!

Versioning *supported*

Page 21: API All the Things!

Validation *supported*

Page 22: API All the Things!

Authentication *supported*

Page 23: API All the Things!

Authorization *supported*

Page 24: API All the Things!

Documentation *supported*

Page 25: API All the Things!

Discovery HATEOAS via HAL

Page 26: API All the Things!

H - HypermediaA - AsT - The E - EngineO - OfA - ApplicationS - State

Page 27: API All the Things!

HAL - Hypermedia Application Language

Page 28: API All the Things!

{ "_links": { "self": { "href": “http://phpcoder.ninja/api/user/dstockto" } } "id": "dstockto", "name": “David Stockton"}

Page 29: API All the Things!

Let’s get started!

Page 30: API All the Things!

php -S 0.0.0.0:8181 -t public/ public/index.php

Page 31: API All the Things!

Please rate this tutorial: https://joind.in/14040