Django Interactive API Documentation

Overview

Default Template. Can be over-written by making a api_docs/apis.html.

Formats

APIs should return JSON by default with XML as an option, but should be discouraged from use as much as possible. JSON is faster, and more lightweight than XML, and considering that many developers use javascript to consume APIs, what could be better than receiving an object back?

Interface

Long gone are the days of SOAP and other crappy implmenations of http based APIs. Why all the fuss over schemas, methods, and properties, when you can just send an HTTP string with a given header and receive the data you exepect? Seriously, REST is the only method you'll see me using.

Blog API

Posts

GET

Get All Blog Posts

http://derek.stegelman.com/blog/api/post

Retrieve a list the list of blog posts. By default you will recieve all of the posts, however, it is advisable to pass the GET paramter of posts=x where x is the number of posts you want.

Parameters
Parameter Value Required Type Description Default
format json No string The format you would like to receive data in json
limit No integer Limit your results to this number 2
Call this methodClear
Call
GET: http://derek.stegelman.com/blog/api/post
GET

Get a Single Blog Post

http://derek.stegelman.com/blog/api/post/{post_id}

Get a single blog post from derek.stegelman.com.

Parameters
Parameter Value Required Type Description Default
format json No string The format you would like to receive data in json
post_id Yes integer ID of the post you would like 1
Call this methodClear
Call
GET: http://derek.stegelman.com/blog/api/post

Homebrew API

Beers

GET

Get ALL Homebrews

http://derek.stegelman.com/beers/api

Get all homebrews that are listed in Derek.Stegelman.Com

Parameters
Parameter Value Required Type Description Default
format json No string The format you would like to receive data in json
limit No integer Limit your results to this number 2
Call this methodClear
Call
GET: http://derek.stegelman.com/beers/api
GET

Get Single Beer

http://derek.stegelman.com/beers/api/{brew_id}

Retrieve a single beer by passing its ID through the URL.

Parameters
Parameter Value Required Type Description Default
format json No string The format you would like to receive data in json
beer_id Yes integer ID of the beer object you would like to retrieve 1
Call this methodClear
Call
GET: http://derek.stegelman.com/beers/api