documenting apis with cats; gluecon 2015

82
Documenting APIs GlueCon 2015 with cats

Upload: avalara-developers

Post on 09-Aug-2015

34 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Documenting APIs With Cats; GlueCon 2015

Documenting APIs

GlueCon 2015

with cats

Page 2: Documenting APIs With Cats; GlueCon 2015

Anya StettlerDeveloper Relations

Avalara

anyarms

Page 3: Documenting APIs With Cats; GlueCon 2015

Why do we need good documentation?

What qualities distinguish “good” documentation?

How can we communicate with developers?

How can we improve existing documentation?

Page 4: Documenting APIs With Cats; GlueCon 2015

Do we really need great docs?

YES!

Page 5: Documenting APIs With Cats; GlueCon 2015

products are complicated

Page 6: Documenting APIs With Cats; GlueCon 2015

documentation is an afterthought

Page 7: Documenting APIs With Cats; GlueCon 2015

Good documentation is good

• Decreases barriers to entry• Decreases support costs• Works as a marketing tool

Page 8: Documenting APIs With Cats; GlueCon 2015

When evaluating an API…

http://www.programmableweb.com/news/api-consumers-want-reliability-documentation-and-community/2013/01/07

Page 9: Documenting APIs With Cats; GlueCon 2015
Page 10: Documenting APIs With Cats; GlueCon 2015

zero to “Hello World”

Page 11: Documenting APIs With Cats; GlueCon 2015

https://developer.yahoo.com/weather/

Page 12: Documenting APIs With Cats; GlueCon 2015

https://developer.yahoo.com/yql/console/

Page 13: Documenting APIs With Cats; GlueCon 2015

Bad documentation makes your users skeptical …

Page 14: Documenting APIs With Cats; GlueCon 2015

… or sad.

Page 15: Documenting APIs With Cats; GlueCon 2015
Page 16: Documenting APIs With Cats; GlueCon 2015
Page 17: Documenting APIs With Cats; GlueCon 2015

What is good documentation?

A comprehensive,navigableresource thatprovides users theinformation to builda painless,maintainable,successfulintegration to yourservice.

Page 18: Documenting APIs With Cats; GlueCon 2015

What is good documentation?

A comprehensive,navigableresource thatprovides users theinformation to builda painless,maintainable,successfulintegration to yourservice.

Page 19: Documenting APIs With Cats; GlueCon 2015

What is good documentation?

A comprehensive,navigableresource thatprovides users theinformation to builda painless,maintainable,successfulintegration to yourservice.

Page 20: Documenting APIs With Cats; GlueCon 2015

What is good documentation?

A comprehensive,navigableresource thatprovides users theinformation to builda painless,maintainable,successfulintegration to yourservice.

Page 21: Documenting APIs With Cats; GlueCon 2015

What is good documentation?

A comprehensive,navigableresource thatprovides users theinformation to builda painless,maintainable,successfulintegration to yourservice.

Page 22: Documenting APIs With Cats; GlueCon 2015

What is good documentation?

A comprehensive,navigableresource thatprovides users theinformation to builda painless,maintainable,successfulintegration to yourservice.

Page 23: Documenting APIs With Cats; GlueCon 2015

Types of Docs• Technical Reference• Sample Code/Code Snippets• Tutorials (written, video, interactive)

• Application Samples• Q&A Resources

Page 24: Documenting APIs With Cats; GlueCon 2015

Technical Reference

• Describe everything in your API– Even things you don’t want people to use

• Structure should follow the structure of the API– But can intentionally diverge

• Primarily values: comprehensive, navigable

• Shortcuts: API design, ‘automatic’ documentation, formatting

Page 25: Documenting APIs With Cats; GlueCon 2015

https://dev.twitter.com/rest/reference/get/search/tweets

Page 26: Documenting APIs With Cats; GlueCon 2015
Page 27: Documenting APIs With Cats; GlueCon 2015

Automatic Documentation

• Less error-prone• Takes less time

… but it’s only part of the story!

• Documentation needs to explain things to people– Different writing skills

• Communication is too important to play second fiddle in comments

Page 28: Documenting APIs With Cats; GlueCon 2015
Page 29: Documenting APIs With Cats; GlueCon 2015

Code Snippets

• Allow users to learn by example

• Demonstrate a single call

• Need to be able to copy/paste content– Must work!

• Primary values: painless• Code should be simple, readable (not clever)

• Example: Stripe, Twilio

Page 30: Documenting APIs With Cats; GlueCon 2015

https://stripe.com/docs/api

Page 31: Documenting APIs With Cats; GlueCon 2015

https://www.twilio.com/docs/api/rest/call

Page 32: Documenting APIs With Cats; GlueCon 2015
Page 33: Documenting APIs With Cats; GlueCon 2015

http://docs.themoviedb.apiary.io/

Page 34: Documenting APIs With Cats; GlueCon 2015

https://github.com/tripit/slate

Page 35: Documenting APIs With Cats; GlueCon 2015

Which Languages?

• At least three languages• At least one raw call/response sample

• Two additional samples implies multi-language support

• Popularity• Target audience• The more the merrier

• as long as they’re maintainable

Page 36: Documenting APIs With Cats; GlueCon 2015

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

Page 37: Documenting APIs With Cats; GlueCon 2015

IEEE Spectrum: Top Programming Languages (web)

http://spectrum.ieee.org/static/interactive-the-top-programming-languages#index

Page 38: Documenting APIs With Cats; GlueCon 2015

Fancy Code Snippetsvia interactive console

• Allows users to play with data

• Real calls to API• User credentials, parameters

• Tools:- Mashery I/O Docs- Apigee- 3scale

Page 39: Documenting APIs With Cats; GlueCon 2015

http://developer.klout.com/io-docs

Page 40: Documenting APIs With Cats; GlueCon 2015
Page 41: Documenting APIs With Cats; GlueCon 2015

https://dev.twitter.com/rest/tools/console

Page 42: Documenting APIs With Cats; GlueCon 2015
Page 43: Documenting APIs With Cats; GlueCon 2015
Page 44: Documenting APIs With Cats; GlueCon 2015
Page 45: Documenting APIs With Cats; GlueCon 2015

http://petstore.swagger.io/

Page 46: Documenting APIs With Cats; GlueCon 2015

Tutorials

• Your product probably has some subtlety– Authorization– Security concerns– Expected workflow

• Can take many formats– Step-by-step articles– Videos/screencasts– Interactive

• Key Values: successful, painless

Page 47: Documenting APIs With Cats; GlueCon 2015

https://stripe.com/docs/tutorials/charges

Page 48: Documenting APIs With Cats; GlueCon 2015

https://www.stellar.org/developers/

Page 49: Documenting APIs With Cats; GlueCon 2015
Page 50: Documenting APIs With Cats; GlueCon 2015
Page 51: Documenting APIs With Cats; GlueCon 2015
Page 52: Documenting APIs With Cats; GlueCon 2015
Page 53: Documenting APIs With Cats; GlueCon 2015
Page 54: Documenting APIs With Cats; GlueCon 2015

Application Samples

• More fully-fledged “learning by example”

• Full integration within an application context

• Larger samples

• More like a POC

• Primary values: readability, navigability

• Example: Twilio

Page 55: Documenting APIs With Cats; GlueCon 2015

https://www.twilio.com/docs/howto/walkthrough/appointment-reminders/ruby/rails

Page 56: Documenting APIs With Cats; GlueCon 2015

Q&A resources

• There will still be unanswered questions– Specific use cases– Combinations of resources

• Public answers benefit the community

• Primary values: navigability, simplicity

Page 57: Documenting APIs With Cats; GlueCon 2015

http://stackoverflow.com/tags

Page 58: Documenting APIs With Cats; GlueCon 2015

http://stackoverflow.com/help/product-support

Page 59: Documenting APIs With Cats; GlueCon 2015

https://developer.salesforce.com/forums/

Page 60: Documenting APIs With Cats; GlueCon 2015

https://twittercommunity.com/

Page 61: Documenting APIs With Cats; GlueCon 2015

A comprehensive, navigable resource that provides users the information to build a painless, maintainable, successful integration to your service. • Technical Reference• Sample Code/code snippets• Tutorials (written, video, interactive)

• Application Samples• Q&A resources

Page 62: Documenting APIs With Cats; GlueCon 2015

Do I really need all those

things?

Page 63: Documenting APIs With Cats; GlueCon 2015

Top 10 APIsArticle• Facebook • Google Maps • Twitter • YouTube • AccuWeather • LinkedIn • Amazon Product Advertising

• Pinterest • Flickr • Google Talk

http://www.programmableweb.com/news/most-popular-apis-least-one-will-surprise-you/2014/01/23http://www.programmableweb.com/apis (As of 2015-02-09)

Popularity• Facebook• Kayak* • Google Maps• Skype • Waze• Netflix* • Fresh Logic Studios Atlas*

• Yahoo Weather• AirBNB*• Twitter

Page 64: Documenting APIs With Cats; GlueCon 2015

What documentation do they offer?

Technical Reference

Code Snippets Tutorials

Interactive Console SDK

Application Samples Q&A

Facebook yes yes yes yes yes yes yes

Google Maps yes yes yes no yes no stack overflow

Twitter yes JSON only yes yes some no yes

YouTube yes yes yes yes yes no stack overflow

AccuWeather yes no* yes no no no no

LinkedIn yes yes yes yes 3rd party no yesAmazon Product Advertising yes 3rd party yes no 3rd party 3rd party yes

Pinterest yes no yes no yes no no

Flickr yes 3rd party yes yes 3rd party no yes

Google Talk** yes yes yes no yes no yes

Twilio yes yes yes no yes yes yes

Skype URI yes yes yes no no no yes

Waze yes yes yes no no no yes

Yahoo Weather yes yes yes yes no no yes

* Does provide a JavaScript sample for one resource ** Replaced May 2013, no longer updated

Page 65: Documenting APIs With Cats; GlueCon 2015

Comprehensive vs. Concise?

• Comprehensive– Full coverage for technical references– Common use cases for tutorials/samples

• Length becomes an issue– affects navigation- dilutes understanding- impacts maintenance

Page 66: Documenting APIs With Cats; GlueCon 2015

Information that isn’t accessible isn’t helpful.

Page 67: Documenting APIs With Cats; GlueCon 2015

Keep it up to date!

• Inaccurate is as bad as missing

• Only way to make integrations maintainable

Page 68: Documenting APIs With Cats; GlueCon 2015

Creating Documentation

• Don’t build it from scratch

• Evaluate the best description format for you

• Use existing tools to make your site all fancy

• Continue to evolve

Page 69: Documenting APIs With Cats; GlueCon 2015

investigate……and keep investigating

Page 70: Documenting APIs With Cats; GlueCon 2015
Page 71: Documenting APIs With Cats; GlueCon 2015
Page 72: Documenting APIs With Cats; GlueCon 2015
Page 73: Documenting APIs With Cats; GlueCon 2015
Page 74: Documenting APIs With Cats; GlueCon 2015
Page 75: Documenting APIs With Cats; GlueCon 2015

http://developer.avalara.com

Page 76: Documenting APIs With Cats; GlueCon 2015
Page 77: Documenting APIs With Cats; GlueCon 2015

https://github.com/avadev

Page 78: Documenting APIs With Cats; GlueCon 2015

http://developer.avalara.com/api-reference

Page 79: Documenting APIs With Cats; GlueCon 2015
Page 80: Documenting APIs With Cats; GlueCon 2015

So much more!• SDKs• Developer Blog• Posted Release Notes• Formatting tools• XML-based docs• Auto-doc tools• Open source docs

Page 81: Documenting APIs With Cats; GlueCon 2015
Page 82: Documenting APIs With Cats; GlueCon 2015

Thanks!

Anya StettlerDeveloper RelationsAvalara

[email protected]

slides available athttp://www.slideshare.net/AnyaStettler