SlideShare a Scribd company logo
APIDOC in a nutshell
Inline Documentation for RESTful web APIs
Ben
Why APIDOC?
Java, JavaScript, PHP, C#, GO, …
/**
* @api {get} /user/:id Request User information
* @apiName GetUser
* @apiGroup User
*
* @apiParam {Number} id Users unique ID.
*
* @apiSuccess {String} firstname Firstname of the User.
* @apiSuccess {String} lastname Lastname of the User.
*/
CoffeeScript
###
@api {get} /user/:id Request User information
@apiName GetUser
@apiGroup User
@apiParam {Number} id Users unique ID.
@apiSuccess {String} firstname Firstname of the User.
@apiSuccess {String} lastname Lastname of the User.
###
Python
“””
@api {get} /user/:id Request User information
@apiName GetUser
@apiGroup User
@apiParam {Number} id Users unique ID.
@apiSuccess {String} firstname Firstname of the User.
@apiSuccess {String} lastname Lastname of the User.
“””
Ruby
=begin
@api {get} /user/:id Request User information
@apiName GetUser
@apiGroup User
@apiParam {Number} id Users unique ID.
@apiSuccess {String} firstname Firstname of the User.
@apiSuccess {String} lastname Lastname of the User.
=end
http://apidoc.happygorgi.com
Installation
cli
gulp
grunt
npm install apidoc -g
npm install grunt-apidoc --save-dev
npm install gulp-apidoc --save-dev
Structure /**
* @api {post} /login Login
* @apiVersion 1.1.2
* @apiName Login
* @apiGroup Auth
*
* @apiParam {String} username Username
* @apiParam {String} password User password
*
* @apiSuccess {String} token token
* @apiSuccess {String} data token
*/
/**
* @api {get} /blockstorage/v1 Get blockstorage welcome message
* @apiVersion 1.1.2
* @apiName WelcomeMessage
* @apiGroup BlockStorage
* @apiHeader {String} Authorization Bearer token value.
*
* @apiSuccess {String} welcomeMsg "This is blockstorage service."
*/
Structure /**
* @api {post} /login Login
* @apiVersion 1.1.2
* @apiName Login
* @apiGroup Auth
*
* @apiParam {String} username Username
* @apiParam {String} password User password
*
* @apiSuccess {String} token token
* @apiSuccess {String} data token
*/
/**
* @api {get} /blockstorage/v1 Get blockstorage welcome message
* @apiVersion 1.1.2
* @apiName WelcomeMessage
* @apiGroup BlockStorage
* @apiHeader {String} Authorization Bearer token value.
*
* @apiSuccess {String} welcomeMsg "This is blockstorage service."
*/
Structure /**
* @api {post} /login Login
* @apiVersion 1.1.2
* @apiName Login
* @apiGroup Auth
*
* @apiParam {String} username Username
* @apiParam {String} password User password
*
* @apiSuccess {String} token token
* @apiSuccess {String} data token
*/
/**
* @api {get} /blockstorage/v1 Get blockstorage welcome message
* @apiVersion 1.1.2
* @apiName WelcomeMessage
* @apiGroup BlockStorage
* @apiHeader {String} Authorization Bearer token value.
*
* @apiSuccess {String} welcomeMsg "This is blockstorage service."
*/
Structure /**
* @api {post} /login Login
* @apiVersion 1.1.2
* @apiName Login
* @apiGroup Auth
*
* @apiParam {String} username Username
* @apiParam {String} password User password
*
* @apiSuccess {String} token token
* @apiSuccess {String} data token
*/
/**
* @api {get} /blockstorage/v1 Get blockstorage welcome message
* @apiVersion 1.1.2
* @apiName WelcomeMessage
* @apiGroup BlockStorage
* @apiHeader {String} Authorization Bearer token value.
*
* @apiSuccess {String} welcomeMsg "This is blockstorage service."
*/
Structure /**
* @api {post} /login Login
* @apiVersion 1.1.2
* @apiName Login
* @apiGroup Auth
*
* @apiParam {String} username Username
* @apiParam {String} password User password
*
* @apiSuccess {String} token token
* @apiSuccess {String} data token
*/
/**
* @api {get} /blockstorage/v1 Get blockstorage welcome message
* @apiVersion 1.1.2
* @apiName WelcomeMessage
* @apiGroup BlockStorage
* @apiHeader {String} Authorization Bearer token value.
*
* @apiSuccess {String} welcomeMsg "This is blockstorage service."
*/
Structure /**
* @api {post} /login Login
* @apiVersion 1.1.2
* @apiName Login
* @apiGroup Auth
*
* @apiParam {String} username Username
* @apiParam {String} password User password
*
* @apiSuccess {String} token token
* @apiSuccess {String} data token
*/
/**
* @api {get} /blockstorage/v1 Get blockstorage welcome message
* @apiVersion 1.1.2
* @apiName WelcomeMessage
* @apiGroup BlockStorage
* @apiHeader {String} Authorization Bearer token value.
*
* @apiSuccess {String} welcomeMsg "This is blockstorage service."
*/
Structure /**
* @api {post} /login Login
* @apiVersion 1.1.2
* @apiName Login
* @apiGroup Auth
*
* @apiParam {String} username Username
* @apiParam {String} password User password
*
* @apiSuccess {String} token token
* @apiSuccess {String} data token
*/
/**
* @api {get} /blockstorage/v1 Get blockstorage welcome message
* @apiVersion 1.1.2
* @apiName WelcomeMessage
* @apiGroup BlockStorage
* @apiHeader {String} Authorization Bearer token value.
*
* @apiSuccess {String} welcomeMsg "This is blockstorage service."
*/
Structure
/**
* @api {put} /user/:id Modify User information
* @apiName PutUser
* @apiGroup User
*
* @apiParam {Number} id Users unique ID.
* @apiParam {String} [firstname] Firstname of the User.
* @apiParam {String} [lastname] Lastname of the User.
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* @apiErrorExample Response (example):
* HTTP/1.1 400 Bad Request
* {
* "error": "UserNameTooShort"
* }
*/
Settings
//package.json
{
"name": "cc-backend",
"description": "An ultimate cloud service that rules the world.",
"version": "1.1.2",
"apidoc": {
"title": "cc api document",
"url": "http://cc.api.hopebaytech.com/api",
"sampleUrl": "http://cc.api.hopebaytech.com/api"
}
}
Live Demo && Q&A

More Related Content

PDF
Introduction to Retrofit
ODP
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
PDF
Rails3 changesets
DOCX
Antivirus Bypass Techniques - 2016
PPTX
ADF in action 1.2
PPTX
Dev Jumpstart: Building Your First App
DOCX
Web-servers & Application Hacking
PDF
Design Patterns in XCUITest
Introduction to Retrofit
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Rails3 changesets
Antivirus Bypass Techniques - 2016
ADF in action 1.2
Dev Jumpstart: Building Your First App
Web-servers & Application Hacking
Design Patterns in XCUITest

Viewers also liked (20)

PPT
Science & measurement
PPT
26 Transmission Lines
PPTX
A.D.S.L. presentation
PPT
Transmission lines
PPT
Units of measurement
PPT
Multimeter
PPTX
Multimeter
PPTX
Ukur Menggunakan Multimeter
PPTX
Multitester
PDF
Strip lines
PPT
Optical time domain Reflectometer
PPTX
Analog multimeter and ohmmeter
PPTX
Voltmeter
DOCX
PPTX
Measurement & instrumentation ppt
PDF
Hst3000 adsl manual_rev b
PPT
1 Units, Measurements, & Conversions
PPT
Newton's 3 laws of Motion
PPT
Ppt Measurements Unit 1
PPSX
Measurement
Science & measurement
26 Transmission Lines
A.D.S.L. presentation
Transmission lines
Units of measurement
Multimeter
Multimeter
Ukur Menggunakan Multimeter
Multitester
Strip lines
Optical time domain Reflectometer
Analog multimeter and ohmmeter
Voltmeter
Measurement & instrumentation ppt
Hst3000 adsl manual_rev b
1 Units, Measurements, & Conversions
Newton's 3 laws of Motion
Ppt Measurements Unit 1
Measurement
Ad

Similar to APIDOC In A Nutshell (20)

PDF
XamarinとAWSをつないでみた話
PDF
Google cloud endpoints
PDF
Google Cloud Endpoints - Soft Uni 19.06.2014
PPT
香港六合彩 » SlideShare
PPT
Baocao Web Tech Java Mail
PDF
Commenting in Agile Development
PDF
Multithreaded sockets c++11
PDF
SendGrid New Features 2016
PPTX
L5 swagger
PPT
General Principles of Web Security
PDF
#startathon2.0 - Spark Core
PDF
Lesson07-UsernamePasswordAuthenticationFilter.pdf
PDF
Laporan multiclient chatting client server
PPT
Micro-ORM Introduction - Don't overcomplicate
PPT
CloudStack EC2 Configuration
PPTX
Araport Workshop Tutorial 2: Authentication and the Agave Profiles Service
PPT
Rapid java backend and api development for mobile devices
PDF
Spring Boot 1.3 News #渋谷Java
PDF
Protocol-Oriented Networking
PDF
Rack Middleware
XamarinとAWSをつないでみた話
Google cloud endpoints
Google Cloud Endpoints - Soft Uni 19.06.2014
香港六合彩 » SlideShare
Baocao Web Tech Java Mail
Commenting in Agile Development
Multithreaded sockets c++11
SendGrid New Features 2016
L5 swagger
General Principles of Web Security
#startathon2.0 - Spark Core
Lesson07-UsernamePasswordAuthenticationFilter.pdf
Laporan multiclient chatting client server
Micro-ORM Introduction - Don't overcomplicate
CloudStack EC2 Configuration
Araport Workshop Tutorial 2: Authentication and the Agave Profiles Service
Rapid java backend and api development for mobile devices
Spring Boot 1.3 News #渋谷Java
Protocol-Oriented Networking
Rack Middleware
Ad

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Encapsulation theory and applications.pdf
PPTX
Cloud computing and distributed systems.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
cuic standard and advanced reporting.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Big Data Technologies - Introduction.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Machine learning based COVID-19 study performance prediction
Dropbox Q2 2025 Financial Results & Investor Presentation
Encapsulation theory and applications.pdf
Cloud computing and distributed systems.
MYSQL Presentation for SQL database connectivity
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Network Security Unit 5.pdf for BCA BBA.
MIND Revenue Release Quarter 2 2025 Press Release
Understanding_Digital_Forensics_Presentation.pptx
cuic standard and advanced reporting.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
sap open course for s4hana steps from ECC to s4
Big Data Technologies - Introduction.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation_ Review paper, used for researhc scholars
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Approach and Philosophy of On baking technology
Machine learning based COVID-19 study performance prediction

APIDOC In A Nutshell

  • 1. APIDOC in a nutshell Inline Documentation for RESTful web APIs Ben
  • 3. Java, JavaScript, PHP, C#, GO, … /** * @api {get} /user/:id Request User information * @apiName GetUser * @apiGroup User * * @apiParam {Number} id Users unique ID. * * @apiSuccess {String} firstname Firstname of the User. * @apiSuccess {String} lastname Lastname of the User. */ CoffeeScript ### @api {get} /user/:id Request User information @apiName GetUser @apiGroup User @apiParam {Number} id Users unique ID. @apiSuccess {String} firstname Firstname of the User. @apiSuccess {String} lastname Lastname of the User. ### Python “”” @api {get} /user/:id Request User information @apiName GetUser @apiGroup User @apiParam {Number} id Users unique ID. @apiSuccess {String} firstname Firstname of the User. @apiSuccess {String} lastname Lastname of the User. “”” Ruby =begin @api {get} /user/:id Request User information @apiName GetUser @apiGroup User @apiParam {Number} id Users unique ID. @apiSuccess {String} firstname Firstname of the User. @apiSuccess {String} lastname Lastname of the User. =end
  • 5. Installation cli gulp grunt npm install apidoc -g npm install grunt-apidoc --save-dev npm install gulp-apidoc --save-dev
  • 6. Structure /** * @api {post} /login Login * @apiVersion 1.1.2 * @apiName Login * @apiGroup Auth * * @apiParam {String} username Username * @apiParam {String} password User password * * @apiSuccess {String} token token * @apiSuccess {String} data token */ /** * @api {get} /blockstorage/v1 Get blockstorage welcome message * @apiVersion 1.1.2 * @apiName WelcomeMessage * @apiGroup BlockStorage * @apiHeader {String} Authorization Bearer token value. * * @apiSuccess {String} welcomeMsg "This is blockstorage service." */
  • 7. Structure /** * @api {post} /login Login * @apiVersion 1.1.2 * @apiName Login * @apiGroup Auth * * @apiParam {String} username Username * @apiParam {String} password User password * * @apiSuccess {String} token token * @apiSuccess {String} data token */ /** * @api {get} /blockstorage/v1 Get blockstorage welcome message * @apiVersion 1.1.2 * @apiName WelcomeMessage * @apiGroup BlockStorage * @apiHeader {String} Authorization Bearer token value. * * @apiSuccess {String} welcomeMsg "This is blockstorage service." */
  • 8. Structure /** * @api {post} /login Login * @apiVersion 1.1.2 * @apiName Login * @apiGroup Auth * * @apiParam {String} username Username * @apiParam {String} password User password * * @apiSuccess {String} token token * @apiSuccess {String} data token */ /** * @api {get} /blockstorage/v1 Get blockstorage welcome message * @apiVersion 1.1.2 * @apiName WelcomeMessage * @apiGroup BlockStorage * @apiHeader {String} Authorization Bearer token value. * * @apiSuccess {String} welcomeMsg "This is blockstorage service." */
  • 9. Structure /** * @api {post} /login Login * @apiVersion 1.1.2 * @apiName Login * @apiGroup Auth * * @apiParam {String} username Username * @apiParam {String} password User password * * @apiSuccess {String} token token * @apiSuccess {String} data token */ /** * @api {get} /blockstorage/v1 Get blockstorage welcome message * @apiVersion 1.1.2 * @apiName WelcomeMessage * @apiGroup BlockStorage * @apiHeader {String} Authorization Bearer token value. * * @apiSuccess {String} welcomeMsg "This is blockstorage service." */
  • 10. Structure /** * @api {post} /login Login * @apiVersion 1.1.2 * @apiName Login * @apiGroup Auth * * @apiParam {String} username Username * @apiParam {String} password User password * * @apiSuccess {String} token token * @apiSuccess {String} data token */ /** * @api {get} /blockstorage/v1 Get blockstorage welcome message * @apiVersion 1.1.2 * @apiName WelcomeMessage * @apiGroup BlockStorage * @apiHeader {String} Authorization Bearer token value. * * @apiSuccess {String} welcomeMsg "This is blockstorage service." */
  • 11. Structure /** * @api {post} /login Login * @apiVersion 1.1.2 * @apiName Login * @apiGroup Auth * * @apiParam {String} username Username * @apiParam {String} password User password * * @apiSuccess {String} token token * @apiSuccess {String} data token */ /** * @api {get} /blockstorage/v1 Get blockstorage welcome message * @apiVersion 1.1.2 * @apiName WelcomeMessage * @apiGroup BlockStorage * @apiHeader {String} Authorization Bearer token value. * * @apiSuccess {String} welcomeMsg "This is blockstorage service." */
  • 12. Structure /** * @api {post} /login Login * @apiVersion 1.1.2 * @apiName Login * @apiGroup Auth * * @apiParam {String} username Username * @apiParam {String} password User password * * @apiSuccess {String} token token * @apiSuccess {String} data token */ /** * @api {get} /blockstorage/v1 Get blockstorage welcome message * @apiVersion 1.1.2 * @apiName WelcomeMessage * @apiGroup BlockStorage * @apiHeader {String} Authorization Bearer token value. * * @apiSuccess {String} welcomeMsg "This is blockstorage service." */
  • 13. Structure /** * @api {put} /user/:id Modify User information * @apiName PutUser * @apiGroup User * * @apiParam {Number} id Users unique ID. * @apiParam {String} [firstname] Firstname of the User. * @apiParam {String} [lastname] Lastname of the User. * * @apiSuccessExample Success-Response: * HTTP/1.1 200 OK * @apiErrorExample Response (example): * HTTP/1.1 400 Bad Request * { * "error": "UserNameTooShort" * } */
  • 14. Settings //package.json { "name": "cc-backend", "description": "An ultimate cloud service that rules the world.", "version": "1.1.2", "apidoc": { "title": "cc api document", "url": "http://cc.api.hopebaytech.com/api", "sampleUrl": "http://cc.api.hopebaytech.com/api" } }