Slide 1

Slide 1 text

Nik Wakelin @nikz

Slide 2

Slide 2 text

API Tools

Slide 3

Slide 3 text

D E V E LO PI N G SU CCE S S FU L AP I s OVERNIGHT!

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

D E V E LO PI N G SU CCE S S FU L AP I s VIA INCREMENTAL AND SUSTAINED EFFORT OVER MANY MONTHS AND PERHAPS EVEN YEARS!!

Slide 6

Slide 6 text

(It won’t happen overnight, but it will happen) D E V E LO PI N G SU CCE S S FU L AP I s

Slide 7

Slide 7 text

1. Make 2. Market 3. Maintain

Slide 8

Slide 8 text

MAKE

Slide 9

Slide 9 text

do we even WANT an API?

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

£THE AP I YO U NEVER BUILD WO N’T CO ST YOU ANY MONEY! ¥ €

Slide 12

Slide 12 text

Who can we copy?

Slide 13

Slide 13 text

ok, WE’RE IN!

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

BEWARE THE IVORY TOWER

Slide 16

Slide 16 text

X X MURDER THE UNICORNS MURDER

Slide 17

Slide 17 text

YOUR API IS UNICORN NOT A

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

YOUR API IS JUST LIKE ANY OT HER FEATURE

Slide 20

Slide 20 text

Iterate, Iterate, Iterate

Slide 21

Slide 21 text

Start SMALL then go BIG

Slide 22

Slide 22 text

LISTEN and ADJUST

Slide 23

Slide 23 text

time to TALK TECH

Slide 24

Slide 24 text

Architecture REST SOAP RPC

Slide 25

Slide 25 text

just use REST Simple & Natural Cacheable Plays nicely with HTTP

Slide 26

Slide 26 text

Resource Anatomy https://rugbywc.com/api/teams/all-blacks Domain

Slide 27

Slide 27 text

Resource Anatomy https://rugbywc.com/api/teams/all-blacks Namespace

Slide 28

Slide 28 text

Resource Anatomy https://rugbywc.com/api/teams/all-blacks Resource

Slide 29

Slide 29 text

Resource Anatomy https://rugbywc.com/api/teams/all-blacks Identifier

Slide 30

Slide 30 text

think nouns: /api/get_emails_for/bob /api/users/bob/emails.json

Slide 31

Slide 31 text

use verbs: POST PATCH PUT GET DELETE HEAD, OPTIONS, …

Slide 32

Slide 32 text

don’t forget about headers: Rate Limiting Caching (ETag, Cache-Control) Ranges (Pagination) API Version?

Slide 33

Slide 33 text

Responses

Slide 34

Slide 34 text

{ "type": "car", "name": "My Ferrari", "cylinders": 512, "options": { "seats": 4, "turbospeed": 360 }, "allowedpassengers": { "family": ["Alice", "Bob"], "friends": ["Charlie", "Diana"] } } My Ferrari 48 4 360 cdrom harddisk > JSON XML

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

JSON API http://jsonapi.org { "data": { "type": "cars", "id": "48", "attributes": { "seats": 4, "turbospeed": 360 }, "relationships": { "allowedpassengers": { // ... } } } }

Slide 37

Slide 37 text

{ post: { id: 211, title: 'Dog Bites Man', author: 'Nik Wakelin', _links: [ { rel: 'comments.new', href: 'posts/211/comments/new' } ] } HATEOAS

Slide 38

Slide 38 text

errors!

Slide 39

Slide 39 text

{ message: "Your caffeine level is too low, try a double espresso!", more_link: "https://developer.yourapi.com/errors/123" } HTTP 1.1 400 Bad Request

Slide 40

Slide 40 text

authentication: OAuth (2.0) HTTP Basic Token (Header, Query)

Slide 41

Slide 41 text

NEVER, EV ER INVENT YOUR OWN AUTH!

Slide 42

Slide 42 text

I’ll quickly hack up a client for this custom auth… 401 401 401 401 401 401 401 401 401 401 401 401 401

Slide 43

Slide 43 text

NEVER, EV ER INVENT YOUR OWN AUTH!

Slide 44

Slide 44 text

oauth 2.0: Good Library Support Plenty of Grant Types Can be hard to get your head around…

Slide 45

Slide 45 text

http basic or API Key Very Simple Revocation? No Application Level Config

Slide 46

Slide 46 text

skip it entirely! https://getkong.org

Slide 47

Slide 47 text

Fake it ‘till you make it! Mock Proxies! http://mockbin.org https://github.com/basicallydan/interfake

Slide 48

Slide 48 text

MARKET

Slide 49

Slide 49 text

Developer Experience “DX”

Slide 50

Slide 50 text

Who can we copy?

Slide 51

Slide 51 text

Docs, Docs, AND MORE DOCS!

Slide 52

Slide 52 text

docs essentials: “Getting Started” API Reference (Sample Code) Explorer (Try it out!) Registration

Slide 53

Slide 53 text

Developer

Slide 54

Slide 54 text

Recipes!

Slide 55

Slide 55 text

https://stripe.com/docs/ “Stripe-style” 3-column

Slide 56

Slide 56 text

Travis CI Top-Notch Narrative Docs docs.travis-ci.com

Slide 57

Slide 57 text

Digital Ocean Community digitalocean.com/community

Slide 58

Slide 58 text

Gelato! https://gelato.io

Slide 59

Slide 59 text

Definition Languages swagger.io apiblueprint.org

Slide 60

Slide 60 text

"/pet":{ "post":{ "summary":"Add a new pet to the store", "parameters":[ { "in":"body", "name":"body", "description":"Pet object that needs to be added to the store", "required":true, "schema":{ "$ref":"#/definitions/Pet" } } ], "responses":{ "405":{ "description":"Invalid input" } }, // ... swagger.io

Slide 61

Slide 61 text

GET MOR E DEV S BY SPEAKING THEI R LANGUAGE

Slide 62

Slide 62 text

Client Libraries - SDKs - Dev Kits + Sample Code!

Slide 63

Slide 63 text

SDK creation Reference Implementation Unirest, HTTParty APIMatic.io Outsource

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

Events!

Slide 66

Slide 66 text

get your swag sorted Stickers (Stickermule) T-Shirts (make ‘em nice!) Coupons & Discounts

Slide 67

Slide 67 text

hackathons make sure your devs are there! great way to help people fun integrations to tweet

Slide 68

Slide 68 text

hiring! (sssh!)

Slide 69

Slide 69 text

(“Mondometer” by @simonvc)

Slide 70

Slide 70 text

hackathons short-term focus effort to organise

Slide 71

Slide 71 text

MA I NTA I N

Slide 72

Slide 72 text

Update. Communicate. …and Mature(ate)

Slide 73

Slide 73 text

Update!

Slide 74

Slide 74 text

Versioning https://rugbywc.com/api/v1/teams

Slide 75

Slide 75 text

Versioning Do your best not to break anything …but don’t stand still.

Slide 76

Slide 76 text

410 GONE

Slide 77

Slide 77 text

analyse and improve Response Times Uptime (Status Page) Errors

Slide 78

Slide 78 text

collect data https://apianalytics.com

Slide 79

Slide 79 text

Communicate!

Slide 80

Slide 80 text

@YourCoAPI

Slide 81

Slide 81 text

slack.com

Slide 82

Slide 82 text

gitter.im

Slide 83

Slide 83 text

“Traditional”…

Slide 84

Slide 84 text

Mature…

Slide 85

Slide 85 text

Last Updated: 3 years ago

Slide 86

Slide 86 text

DON’T FO RG ET TO SHOW OFF!

Slide 87

Slide 87 text

Xero Add-On Directory Marketplace xero.com/add-ons

Slide 88

Slide 88 text

Help your API developers make money.

Slide 89

Slide 89 text

Help your API developers build businesses.

Slide 90

Slide 90 text

INTEG RATIONS C AN BE A MAJOR COMPETI TIVE ADVANTAGE

Slide 91

Slide 91 text

BE VERY CAREFUL OF ACQUISITIONS

Slide 92

Slide 92 text

IN SHORT, FOR AN AMAZING API YOU NEED TO…

Slide 93

Slide 93 text

X X MURDER THE UNICORNS MURDER

Slide 94

Slide 94 text

Developer GREAT STORY TELL A

Slide 95

Slide 95 text

KEEP IT UP!

Slide 96

Slide 96 text

DON’T EXPECT IT TO HAPPEN OVERNIGHT

Slide 97

Slide 97 text

Nik Wakelin @nikz

Slide 98

Slide 98 text

Image Credits Switch from Marcin Wichary on Flickr (https://www.flickr.com/photos/mwichary/2356651346) Blocks from Holger Zscheyge on Flickr (https://www.flickr.com/photos/zscheyge/49012397) Unicorn from (https://thenounproject.com/search/?q=unicorn&i=9584) Sign from John McLinden on Flickr (https://www.flickr.com/photos/fogey03/16838534116/) (Bad Photoshop is all me) Unicorn cupcake from kirstin_b on flickr (https://www.flickr.com/photos/kristinausk/4121781145/) Shape Sorter from SpAvAAi on Flickr https://www.flickr.com/photos/spavaai/2536426227/ Disconnected Phone from mrdarkroom on Flickr https://www.flickr.com/photos/mrdarkroom/5357276454 Leaning Tower from Kit on Flickr (https://www.flickr.com/photos/practicalowl/18648955463/) Crane from Nicolás Boullosa on Flickr (https://www.flickr.com/photos/faircompanies/20519433104/) Clown Fish & Blue Tang from Iooyaa on Flickr (https://www.flickr.com/photos/58196275@N04/8636837527/) Cookies from george.bremer on Flickr (https://www.flickr.com/photos/ghbremer/5276304808) ❤

Slide 99

Slide 99 text

Image Credits Seedling from lev-shine on Flickr https://www.flickr.com/photos/kevinshine/9984357243/) Beer from Alan Levine on Flickr (https://www.flickr.com/photos/cogdog/21127813750) Airshow by Pavel N from the Noun Project Abandoned Six Flags from Darrell Miller on Flickr (https://www.flickr.com/photos/darrellrhodesmiller/6904703505) Tui Bird from Cat Burton on Flickr (https://www.flickr.com/photos/catburton/16023893948/) Mailboxes from Olga Caprotti on Flickr (https://www.flickr.com/photos/__olga__/2822660113/) Lock by Michael Martinho from the Noun Project Key by John Caserta from the Noun Project User by Wilson Joseph from the Noun Project Loudhailer from Lis Ferla on flickr (https://www.flickr.com/photos/lastyearsgirl_/3537374056/) Linux Kernel Baby from Harald Groven on flickr (https://www.flickr.com/photos/kongharald/13242684424) Rainbow Tiles from Steve Snodgrass on Flickr (https://www.flickr.com/photos/stevensnodgrass/6807424348) Empty Classroom from KT King on Flickr (https://www.flickr.com/photos/xtrah/4853491803/) Cycle Hire from Kirk Siang on Flickr (https://www.flickr.com/photos/kirksiang/6180888330) ❤