SlideShare a Scribd company logo
1 of 38
Download to read offline
© 2014 - Proprietary and Confidential Information of FINCAD
An example-based approach
(by Lois Patterson)
Creating Good API
Documentation
© 2014 - Proprietary and Confidential Information of FINCAD
Why APIs and API Documentation
Matters
● Explosive growth in APIs: everyone wants
them (maybe 200K in 2014?)
● Amazon’s success linked to API-based
approach
● Lego-based approach to software
development--natural evolution of object-
orientation
© 2014 - Proprietary and Confidential Information of FINCAD
Vast world of APIs
• ProgrammableWeb.com - tens of thousands
of APIs, mashups
• APIs for:
• Burning Man
• Birdsongs
• Facial recognition
• ?
© 2014 - Proprietary and Confidential Information of FINCAD
Not just developers
You know how to use APIs
Do you ever embed YouTube videos in your
blog?
<iframe width="560" height="315"
src="//www.youtube.com/embed/LJr6FknZhpM
" frameborder="0" allowfullscreen></iframe>
YouTube provides that code with Share.
© 2014 - Proprietary and Confidential Information of FINCAD
YouTube Embed Code
© 2014 - Proprietary and Confidential Information of FINCAD
API to embed video (2)
© 2014 - Proprietary and Confidential Information of FINCAD
Why API docs matter
• Without documentation, an API is almost
completely inaccessible.
• For a determined hacker, perhaps possible.
• For the regular user without docs, disaster.
• API docs make the API product possible,
much more so than for GUI software.
• Developers do RTFM (read the … manual) for
APIs.
© 2014 - Proprietary and Confidential Information of FINCAD
Good APIs good API docs
• Start with a good API to make good API docs
• Consistency!
© 2014 - Proprietary and Confidential Information of FINCAD
REST APIs in a Nutshell
• Verbs (GET, POST, PUT, DELETE -- maybe PATCH, but it is
controversial)
• Nouns (Also called objects or resources)
• Apply verbs to nouns
• Simple and intuitive? For example:
o Get a movie_ID
o Post (create) a person_ID
o Put (edit by replacing) a rating_ID
o Delete an entry_ID (from a queue)
© 2014 - Proprietary and Confidential Information of FINCAD
CRUD principle
• CRUD (Create/Read/Update/Delete)
• But what you create, what you select to
read or update or delete, is not
necessarily simple
© 2014 - Proprietary and Confidential Information of FINCAD
Example: API Consistency and Use
Cases in Netflix
Endpoint for a movie title, by title ID:
http://api-public.netflix.com/catalog/titles/movies/title_id
Endpoint for a TV program, by program ID:
http://api-
public.netflix.com/catalog/titles/programs/program_id
Endpoint for a person, by person ID:
http://api-public.netflix.com/catalog/people/person_id
© 2014 - Proprietary and Confidential Information of FINCAD
How about PayPal?
© 2014 - Proprietary and Confidential Information of FINCAD
Some RESTful APIs with great docs
● Netflix
● Twitter
● Github
● Facebook
● PayPal
● Flickr
● Google
© 2014 - Proprietary and Confidential Information of FINCAD
Why are these good APIs?
Netflix - Just a well-done API (sadly, it has not
been updated and no publicly available keys
anymore)
Twitter - Really clear definition of objects and
what you can do with them
Github - Simple and everything is there
© 2014 - Proprietary and Confidential Information of FINCAD
How do I help make a good API?
● Be involved in the beginning.
● Read design documents (they exist, right?)
● If no design document, can you write it?
● Try writing some sample documentation for
this fledgling API – doc first?
● Best is if QA, Documentation, Development
(not to mention Product Management) are
together in the design phase
© 2014 - Proprietary and Confidential Information of FINCAD
Important features of a good API
● Consistency
● Good error messages
● Clear naming conventions
● Just like for any other software product!
© 2014 - Proprietary and Confidential Information of FINCAD
API standards?
● Very popular APIs tend to become de facto
standards
● Standards include: REST, RPC, etc.
● REST is probably winning the day
© 2014 - Proprietary and Confidential Information of FINCAD
Can your API be as easy as
YouTube?
● Yes! For at least a few features.
● YouTube includes more complicated features:
https://developers.google.com/youtube/
● A lot of work to get something that simple
● Typical Twitter program (Python) to get a
mass of tweets and save them to a file using
the RESTful API: about 35 lines
If you want mass-market adoption, simplicity is
paramount.
© 2014 - Proprietary and Confidential Information of FINCAD
API Demonstration and Testing
Tools
• Swagger (Django REST Swagger)
• Atlassian REST browser
• Google Advanced REST client
• cURL
Show AND Tell with these tools.
May need developer help—this is for
everyone’s benefit!
© 2014 - Proprietary and Confidential Information of FINCAD
Pet Store Swagger
© 2014 - Proprietary and Confidential Information of FINCAD
Pet Store Swagger
© 2014 - Proprietary and Confidential Information of FINCAD
Model in Swagger
© 2014 - Proprietary and Confidential Information of FINCAD
Model
© 2014 - Proprietary and Confidential Information of FINCAD
What goes in the POST box?
{
"name":"Naive Cash Discounting USD",
"format":"f3ml",
"definition":
"<f><n>ExtendModelWithBootstrappedInterpolationCurve</n><a><p><n>AutoSort</n><v><r>
<b>F</b></r></v></p>
<p><n>BaseModel</n><v><r><s>${-
1}</s></r></v></p><p><n>BootstrappingObjective</n><v><r><s>SingleCurrencyValue</s><
/r></v></p>
<p><n>CurveTag</n><v><r><s>USD</s><s>DiscountCurve</s></r></v></p><p><n>Inter
polationMethod</n><v><r><s>LogLinear</s></r></v></p>
<p><n>MarketDataTag</n><v><r><s>CashDeposit:USD</s><s>CashDepo</s></r></v></p
><p><n>ModelName</n><v><r><s></s></r></v></p></a></f>"
}
© 2014 - Proprietary and Confidential Information of FINCAD
Model by slug
© 2014 - Proprietary and Confidential Information of FINCAD
Flickr API Garden
Look what you can do:
https://www.flickr.com/services/api/explore/?method=flickr.photos.search
© 2014 - Proprietary and Confidential Information of FINCAD
PayPal test environment
PayPal
https://developer.paypal.com/docs/classic/lifecycle/ug_sandbox/
© 2014 - Proprietary and Confidential Information of FINCAD
API docs should include …
• Description
• Tutorials
• Examples (Snippets, working apps)
• Sandbox test environment
• FAQs
© 2014 - Proprietary and Confidential Information of FINCAD
Your API docs should have …
● Clear versioning. (And when coding, use
version number of the API.)
● Last-verified date, particularly for Web apps.
● FAQ
● Working code samples
● Suggestions for using API
© 2014 - Proprietary and Confidential Information of FINCAD
Twitter helps the API user
Twitter site:
There are a few great ways to follow the changes we make to
the Twitter platform:
• Follow @twitterapi.
• Keep track of our Developer Blog and Discussions.
• See the recently updated documentation.
• Consult the Platform Calendar.
© 2014 - Proprietary and Confidential Information of FINCAD
Backlinks
Twitter
© 2014 - Proprietary and Confidential Information of FINCAD
Twitter API doc page
© 2014 - Proprietary and Confidential Information of FINCAD
How do I get code samples?
• Laziness! I encourage it!
• Developers have created samples for tests (or
they should!)
• Quality Assurance has created samples for
tests
• Take these samples
• Agree on a standard style
• Build more based on these samples
© 2014 - Proprietary and Confidential Information of FINCAD
Do I need to code?
• Empathy with our users is a core requirement
for a tech writer
• Learn to read and edit code
• Increase your code-creation abilities
• Coursera, Udacity, Khan Academy, etc.
• Use support groups
• All code samples are documentation; not all
documentation is code.
© 2014 - Proprietary and Confidential Information of FINCAD
API Tutorial to try
Sarah Maddox, previously of Atlassian and now
of Google, wrote this tutorial:
http://ffeathers.wordpress.com/2014/09/28/wa
nt-a-rest-api-to-play-with/
Learn about code, docs, API design in one go!
© 2014 - Proprietary and Confidential Information of FINCAD
Resources
http://jacobian.org/writing/what-to-write/
http://www.theparticlelab.com/good-api-documentation/
http://ffeathers.wordpress.com/
http://www.idratherbewriting.com/
http://www.programmableweb.com/
https://helloreverb.com/developers/swagger
http://stackoverflow.com/questions/2001899/creating-great-api-documentation-tools-and-techniques
http://stackoverflow.com/questions/1515326/what-do-you-consider-good-api-documentation
https://www.youtube.com/watch?v=C5ws9ZNUfxc
http://www.apiacademy.co
http://apievangelist.com/2014/09/20/my-api-101-workshop-at-apistrat-in-chicago-next-week
and more!
© 2014 - Proprietary and Confidential Information of FINCAD
© 2014 - Proprietary and Confidential Information of FINCAD
L.Patterson@fincad.com
@LoisRP

More Related Content

More from soapconf

Anton Bollen - What Makes a Video Effective?; soap! 2015
Anton Bollen - What Makes a Video Effective?; soap! 2015Anton Bollen - What Makes a Video Effective?; soap! 2015
Anton Bollen - What Makes a Video Effective?; soap! 2015soapconf
 
Adam Sanyo - Conref, conkeyref, conrefpush: Reuse strategies when working on ...
Adam Sanyo - Conref, conkeyref, conrefpush: Reuse strategies when working on ...Adam Sanyo - Conref, conkeyref, conrefpush: Reuse strategies when working on ...
Adam Sanyo - Conref, conkeyref, conrefpush: Reuse strategies when working on ...soapconf
 
Ray Gallon - Complexity, Nemetics, and Wicked Tech Comm; soap! 2015
Ray Gallon - Complexity, Nemetics, and Wicked Tech Comm; soap! 2015Ray Gallon - Complexity, Nemetics, and Wicked Tech Comm; soap! 2015
Ray Gallon - Complexity, Nemetics, and Wicked Tech Comm; soap! 2015soapconf
 
Rick Yagodich - Onramp: Making the case for author experience; soapconf 2014
Rick Yagodich - Onramp: Making the case for author experience; soapconf 2014Rick Yagodich - Onramp: Making the case for author experience; soapconf 2014
Rick Yagodich - Onramp: Making the case for author experience; soapconf 2014soapconf
 
Ray Gallon - Your most important business asset - Build a better end-to-end c...
Ray Gallon - Your most important business asset - Build a better end-to-end c...Ray Gallon - Your most important business asset - Build a better end-to-end c...
Ray Gallon - Your most important business asset - Build a better end-to-end c...soapconf
 
Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...
Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...
Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...soapconf
 
Kasia Mrowca - How to defeat feature gluttony; soapconf 2014
Kasia Mrowca - How to defeat feature gluttony; soapconf 2014Kasia Mrowca - How to defeat feature gluttony; soapconf 2014
Kasia Mrowca - How to defeat feature gluttony; soapconf 2014soapconf
 
Noz Urbina - Messages for your manager about content; soapconf 2014
Noz Urbina - Messages for your manager about content; soapconf 2014Noz Urbina - Messages for your manager about content; soapconf 2014
Noz Urbina - Messages for your manager about content; soapconf 2014soapconf
 
Agnieszka Tkaczyk - Using infographics in technical communication; soapconf 2014
Agnieszka Tkaczyk - Using infographics in technical communication; soapconf 2014Agnieszka Tkaczyk - Using infographics in technical communication; soapconf 2014
Agnieszka Tkaczyk - Using infographics in technical communication; soapconf 2014soapconf
 
Monika Konieczny - Gamification & storytelling: how to turn boring technical ...
Monika Konieczny - Gamification & storytelling: how to turn boring technical ...Monika Konieczny - Gamification & storytelling: how to turn boring technical ...
Monika Konieczny - Gamification & storytelling: how to turn boring technical ...soapconf
 
Kevin Duncan - Speaking the visual language using images for effective commun...
Kevin Duncan - Speaking the visual language using images for effective commun...Kevin Duncan - Speaking the visual language using images for effective commun...
Kevin Duncan - Speaking the visual language using images for effective commun...soapconf
 

More from soapconf (11)

Anton Bollen - What Makes a Video Effective?; soap! 2015
Anton Bollen - What Makes a Video Effective?; soap! 2015Anton Bollen - What Makes a Video Effective?; soap! 2015
Anton Bollen - What Makes a Video Effective?; soap! 2015
 
Adam Sanyo - Conref, conkeyref, conrefpush: Reuse strategies when working on ...
Adam Sanyo - Conref, conkeyref, conrefpush: Reuse strategies when working on ...Adam Sanyo - Conref, conkeyref, conrefpush: Reuse strategies when working on ...
Adam Sanyo - Conref, conkeyref, conrefpush: Reuse strategies when working on ...
 
Ray Gallon - Complexity, Nemetics, and Wicked Tech Comm; soap! 2015
Ray Gallon - Complexity, Nemetics, and Wicked Tech Comm; soap! 2015Ray Gallon - Complexity, Nemetics, and Wicked Tech Comm; soap! 2015
Ray Gallon - Complexity, Nemetics, and Wicked Tech Comm; soap! 2015
 
Rick Yagodich - Onramp: Making the case for author experience; soapconf 2014
Rick Yagodich - Onramp: Making the case for author experience; soapconf 2014Rick Yagodich - Onramp: Making the case for author experience; soapconf 2014
Rick Yagodich - Onramp: Making the case for author experience; soapconf 2014
 
Ray Gallon - Your most important business asset - Build a better end-to-end c...
Ray Gallon - Your most important business asset - Build a better end-to-end c...Ray Gallon - Your most important business asset - Build a better end-to-end c...
Ray Gallon - Your most important business asset - Build a better end-to-end c...
 
Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...
Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...
Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...
 
Kasia Mrowca - How to defeat feature gluttony; soapconf 2014
Kasia Mrowca - How to defeat feature gluttony; soapconf 2014Kasia Mrowca - How to defeat feature gluttony; soapconf 2014
Kasia Mrowca - How to defeat feature gluttony; soapconf 2014
 
Noz Urbina - Messages for your manager about content; soapconf 2014
Noz Urbina - Messages for your manager about content; soapconf 2014Noz Urbina - Messages for your manager about content; soapconf 2014
Noz Urbina - Messages for your manager about content; soapconf 2014
 
Agnieszka Tkaczyk - Using infographics in technical communication; soapconf 2014
Agnieszka Tkaczyk - Using infographics in technical communication; soapconf 2014Agnieszka Tkaczyk - Using infographics in technical communication; soapconf 2014
Agnieszka Tkaczyk - Using infographics in technical communication; soapconf 2014
 
Monika Konieczny - Gamification & storytelling: how to turn boring technical ...
Monika Konieczny - Gamification & storytelling: how to turn boring technical ...Monika Konieczny - Gamification & storytelling: how to turn boring technical ...
Monika Konieczny - Gamification & storytelling: how to turn boring technical ...
 
Kevin Duncan - Speaking the visual language using images for effective commun...
Kevin Duncan - Speaking the visual language using images for effective commun...Kevin Duncan - Speaking the visual language using images for effective commun...
Kevin Duncan - Speaking the visual language using images for effective commun...
 

Recently uploaded

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Recently uploaded (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Lois Patterson - Learning how to document APIs by example; soapconf 2014

  • 1. © 2014 - Proprietary and Confidential Information of FINCAD An example-based approach (by Lois Patterson) Creating Good API Documentation
  • 2. © 2014 - Proprietary and Confidential Information of FINCAD Why APIs and API Documentation Matters ● Explosive growth in APIs: everyone wants them (maybe 200K in 2014?) ● Amazon’s success linked to API-based approach ● Lego-based approach to software development--natural evolution of object- orientation
  • 3. © 2014 - Proprietary and Confidential Information of FINCAD Vast world of APIs • ProgrammableWeb.com - tens of thousands of APIs, mashups • APIs for: • Burning Man • Birdsongs • Facial recognition • ?
  • 4. © 2014 - Proprietary and Confidential Information of FINCAD Not just developers You know how to use APIs Do you ever embed YouTube videos in your blog? <iframe width="560" height="315" src="//www.youtube.com/embed/LJr6FknZhpM " frameborder="0" allowfullscreen></iframe> YouTube provides that code with Share.
  • 5. © 2014 - Proprietary and Confidential Information of FINCAD YouTube Embed Code
  • 6. © 2014 - Proprietary and Confidential Information of FINCAD API to embed video (2)
  • 7. © 2014 - Proprietary and Confidential Information of FINCAD Why API docs matter • Without documentation, an API is almost completely inaccessible. • For a determined hacker, perhaps possible. • For the regular user without docs, disaster. • API docs make the API product possible, much more so than for GUI software. • Developers do RTFM (read the … manual) for APIs.
  • 8. © 2014 - Proprietary and Confidential Information of FINCAD Good APIs good API docs • Start with a good API to make good API docs • Consistency!
  • 9. © 2014 - Proprietary and Confidential Information of FINCAD REST APIs in a Nutshell • Verbs (GET, POST, PUT, DELETE -- maybe PATCH, but it is controversial) • Nouns (Also called objects or resources) • Apply verbs to nouns • Simple and intuitive? For example: o Get a movie_ID o Post (create) a person_ID o Put (edit by replacing) a rating_ID o Delete an entry_ID (from a queue)
  • 10. © 2014 - Proprietary and Confidential Information of FINCAD CRUD principle • CRUD (Create/Read/Update/Delete) • But what you create, what you select to read or update or delete, is not necessarily simple
  • 11. © 2014 - Proprietary and Confidential Information of FINCAD Example: API Consistency and Use Cases in Netflix Endpoint for a movie title, by title ID: http://api-public.netflix.com/catalog/titles/movies/title_id Endpoint for a TV program, by program ID: http://api- public.netflix.com/catalog/titles/programs/program_id Endpoint for a person, by person ID: http://api-public.netflix.com/catalog/people/person_id
  • 12. © 2014 - Proprietary and Confidential Information of FINCAD How about PayPal?
  • 13. © 2014 - Proprietary and Confidential Information of FINCAD Some RESTful APIs with great docs ● Netflix ● Twitter ● Github ● Facebook ● PayPal ● Flickr ● Google
  • 14. © 2014 - Proprietary and Confidential Information of FINCAD Why are these good APIs? Netflix - Just a well-done API (sadly, it has not been updated and no publicly available keys anymore) Twitter - Really clear definition of objects and what you can do with them Github - Simple and everything is there
  • 15. © 2014 - Proprietary and Confidential Information of FINCAD How do I help make a good API? ● Be involved in the beginning. ● Read design documents (they exist, right?) ● If no design document, can you write it? ● Try writing some sample documentation for this fledgling API – doc first? ● Best is if QA, Documentation, Development (not to mention Product Management) are together in the design phase
  • 16. © 2014 - Proprietary and Confidential Information of FINCAD Important features of a good API ● Consistency ● Good error messages ● Clear naming conventions ● Just like for any other software product!
  • 17. © 2014 - Proprietary and Confidential Information of FINCAD API standards? ● Very popular APIs tend to become de facto standards ● Standards include: REST, RPC, etc. ● REST is probably winning the day
  • 18. © 2014 - Proprietary and Confidential Information of FINCAD Can your API be as easy as YouTube? ● Yes! For at least a few features. ● YouTube includes more complicated features: https://developers.google.com/youtube/ ● A lot of work to get something that simple ● Typical Twitter program (Python) to get a mass of tweets and save them to a file using the RESTful API: about 35 lines If you want mass-market adoption, simplicity is paramount.
  • 19. © 2014 - Proprietary and Confidential Information of FINCAD API Demonstration and Testing Tools • Swagger (Django REST Swagger) • Atlassian REST browser • Google Advanced REST client • cURL Show AND Tell with these tools. May need developer help—this is for everyone’s benefit!
  • 20. © 2014 - Proprietary and Confidential Information of FINCAD Pet Store Swagger
  • 21. © 2014 - Proprietary and Confidential Information of FINCAD Pet Store Swagger
  • 22. © 2014 - Proprietary and Confidential Information of FINCAD Model in Swagger
  • 23. © 2014 - Proprietary and Confidential Information of FINCAD Model
  • 24. © 2014 - Proprietary and Confidential Information of FINCAD What goes in the POST box? { "name":"Naive Cash Discounting USD", "format":"f3ml", "definition": "<f><n>ExtendModelWithBootstrappedInterpolationCurve</n><a><p><n>AutoSort</n><v><r> <b>F</b></r></v></p> <p><n>BaseModel</n><v><r><s>${- 1}</s></r></v></p><p><n>BootstrappingObjective</n><v><r><s>SingleCurrencyValue</s>< /r></v></p> <p><n>CurveTag</n><v><r><s>USD</s><s>DiscountCurve</s></r></v></p><p><n>Inter polationMethod</n><v><r><s>LogLinear</s></r></v></p> <p><n>MarketDataTag</n><v><r><s>CashDeposit:USD</s><s>CashDepo</s></r></v></p ><p><n>ModelName</n><v><r><s></s></r></v></p></a></f>" }
  • 25. © 2014 - Proprietary and Confidential Information of FINCAD Model by slug
  • 26. © 2014 - Proprietary and Confidential Information of FINCAD Flickr API Garden Look what you can do: https://www.flickr.com/services/api/explore/?method=flickr.photos.search
  • 27. © 2014 - Proprietary and Confidential Information of FINCAD PayPal test environment PayPal https://developer.paypal.com/docs/classic/lifecycle/ug_sandbox/
  • 28. © 2014 - Proprietary and Confidential Information of FINCAD API docs should include … • Description • Tutorials • Examples (Snippets, working apps) • Sandbox test environment • FAQs
  • 29. © 2014 - Proprietary and Confidential Information of FINCAD Your API docs should have … ● Clear versioning. (And when coding, use version number of the API.) ● Last-verified date, particularly for Web apps. ● FAQ ● Working code samples ● Suggestions for using API
  • 30. © 2014 - Proprietary and Confidential Information of FINCAD Twitter helps the API user Twitter site: There are a few great ways to follow the changes we make to the Twitter platform: • Follow @twitterapi. • Keep track of our Developer Blog and Discussions. • See the recently updated documentation. • Consult the Platform Calendar.
  • 31. © 2014 - Proprietary and Confidential Information of FINCAD Backlinks Twitter
  • 32. © 2014 - Proprietary and Confidential Information of FINCAD Twitter API doc page
  • 33. © 2014 - Proprietary and Confidential Information of FINCAD How do I get code samples? • Laziness! I encourage it! • Developers have created samples for tests (or they should!) • Quality Assurance has created samples for tests • Take these samples • Agree on a standard style • Build more based on these samples
  • 34. © 2014 - Proprietary and Confidential Information of FINCAD Do I need to code? • Empathy with our users is a core requirement for a tech writer • Learn to read and edit code • Increase your code-creation abilities • Coursera, Udacity, Khan Academy, etc. • Use support groups • All code samples are documentation; not all documentation is code.
  • 35. © 2014 - Proprietary and Confidential Information of FINCAD API Tutorial to try Sarah Maddox, previously of Atlassian and now of Google, wrote this tutorial: http://ffeathers.wordpress.com/2014/09/28/wa nt-a-rest-api-to-play-with/ Learn about code, docs, API design in one go!
  • 36. © 2014 - Proprietary and Confidential Information of FINCAD Resources http://jacobian.org/writing/what-to-write/ http://www.theparticlelab.com/good-api-documentation/ http://ffeathers.wordpress.com/ http://www.idratherbewriting.com/ http://www.programmableweb.com/ https://helloreverb.com/developers/swagger http://stackoverflow.com/questions/2001899/creating-great-api-documentation-tools-and-techniques http://stackoverflow.com/questions/1515326/what-do-you-consider-good-api-documentation https://www.youtube.com/watch?v=C5ws9ZNUfxc http://www.apiacademy.co http://apievangelist.com/2014/09/20/my-api-101-workshop-at-apistrat-in-chicago-next-week and more!
  • 37. © 2014 - Proprietary and Confidential Information of FINCAD
  • 38. © 2014 - Proprietary and Confidential Information of FINCAD L.Patterson@fincad.com @LoisRP