Last active
December 24, 2015 01:49
-
-
Save subosito/6725894 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Real World API</title> | |
<meta name="description" content="This API Blueprint demonstrates a real world example documenting a portion of [App.net API](http://developers.app.net). | |
"> | |
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"> | |
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> | |
<style> | |
body { | |
font-family: 'Open Sans', sans-serif; | |
} | |
tt, pre, code { | |
font-family: Consolas, "Liberation Mono", Courier, monospace; | |
background-color: transparent !important; | |
} | |
pre.prettyprint { | |
border: 0px !important; | |
background-color: #fff; | |
} | |
.bg-default { | |
background-color: #F8F8F8; | |
} | |
.response-snippet { | |
display: none; | |
} | |
.nav-rg { | |
width: 262.5px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-12"> | |
<div class="page-header"> | |
<h1>Real World API</h1> | |
<h2 class="lead"><small><p>This API Blueprint demonstrates a real world example documenting a portion of <a href="http://developers.app.net">App.net API</a>.</p> | |
</small></h2> | |
</div> | |
</div> | |
<div class="col-md-3"> | |
<ul class="nav nav-pills nav-stacked nav-rg affix" id="group-tab"> | |
<li><a href="#posts" data-toggle="tab"><strong>Posts</strong></a></li> | |
</ul> | |
</div> | |
<div class="col-md-9"> | |
<div class="tab-content"> | |
<div class="tab-pane" id="posts"> | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<h2 id="posts">Posts</h2> | |
</div> | |
<div class="panel-body"> | |
<p class="lead"><small>This section groups App.net post resources. | |
</small></p> | |
<div class="panel panel-info"> | |
<div class="panel-heading"> | |
<span class="btn btn-primary">GET</span> | |
<code>/stream/0/posts/{post_id}</code> | |
</div> | |
<div class="panel-body"> | |
<p>Returns a specific Post.</p> | |
</div> | |
<ul class="list-group"> | |
<li class="list-group-item bg-default"><strong>Parameters</strong></li> | |
<li class="list-group-item"> | |
<dl class="dl-horizontal"> | |
<dt>post_id</dt> | |
<dd> | |
<strong>(required)</strong> | |
<code>string</code> The id of the Post. | |
</dd> | |
</dl> | |
</li> | |
<li class="list-group-item bg-default response"> | |
<strong>Response <code>200</code></strong> | |
<a href="javascript:;" class="pull-right btn btn-default btn-sm snippet-toggle" data-target="response-snippet"><small>SHOW</small></a> | |
</li> | |
<li class="list-group-item response-snippet" style="list-style: none"> | |
<code>< Content-Type: application/json</code><br> | |
<pre class="prettyprint">{ | |
"data": { | |
"id": "1", // note this is a string | |
"user": { | |
... | |
}, | |
"created_at": "2012-07-16T17:25:47Z", | |
"text": "@berg FIRST post on this new site #newsocialnetwork", | |
"source": { | |
"client_id": "udxGzAVBdXwGtkHmvswR5MbMEeVnq6n4", | |
"name": "Clientastic for iOS", | |
"link": "http://app.net" | |
}, | |
"machine_only": false, | |
"reply_to": null, | |
"thread_id": "1", | |
"num_replies": 3, | |
"num_reposts": 0, | |
"num_stars": 0, | |
"entities": { | |
"mentions": [{ | |
"name": "berg", | |
"id": "2", | |
"pos": 0, | |
"len": 5 | |
}], | |
"hashtags": [{ | |
"name": "newsocialnetwork", | |
"pos": 34, | |
"len": 17 | |
}], | |
"links": [{ | |
"text": "this new site", | |
"url": "https://join.app.net" | |
"pos": 20, | |
"len": 13 | |
}] | |
}, | |
"you_reposted": false, | |
"you_starred": false | |
}, | |
"meta": { | |
"code": 200, | |
} | |
} | |
</pre> | |
</li> | |
</ul> | |
</div> | |
<div class="panel panel-info"> | |
<div class="panel-heading"> | |
<span class="btn btn-danger">DELETE</span> | |
<code>/stream/0/posts/{post_id}</code> | |
</div> | |
<div class="panel-body"> | |
<p>Delete a Post. The current user must be the same user who created the Post. It returns the deleted Post on success.</p> | |
</div> | |
<ul class="list-group"> | |
<li class="list-group-item bg-default"><strong>Parameters</strong></li> | |
<li class="list-group-item"> | |
<dl class="dl-horizontal"> | |
<dt>post_id</dt> | |
<dd> | |
<strong>(required)</strong> | |
<code>string</code> The id of the Post. | |
</dd> | |
</dl> | |
</li> | |
<li class="list-group-item bg-default response"> | |
<strong>Response <code>204</code></strong> | |
</li> | |
<li class="list-group-item response-snippet" style="list-style: none"> | |
</li> | |
</ul> | |
</div> | |
<div class="panel panel-info"> | |
<div class="panel-heading"> | |
<span class="btn btn-success">POST</span> | |
<code>/stream/0/posts</code> | |
</div> | |
<div class="panel-body"> | |
<p>Create a new Post object. Mentions and hashtags will be parsed out of the post text, as will bare URLs…</p> | |
</div> | |
<ul class="list-group"> | |
<li class="list-group-item bg-default response"> | |
<strong>Requests</strong> | |
<a href="javascript:;" class="pull-right btn btn-default btn-sm snippet-toggle" data-target="request-snippet"><small>SHOW</small></a> | |
</li> | |
<li class="list-group-item request-snippet" style="display: none"> | |
<code>> Content-Type: application/json</code><br> | |
<pre class="prettyprint">{ | |
"data": { | |
"id": "1", // note this is a string | |
"user": { | |
... | |
}, | |
"created_at": "2012-07-16T17:25:47Z", | |
"text": "@berg FIRST post on this new site #newsocialnetwork", | |
"source": { | |
"client_id": "udxGzAVBdXwGtkHmvswR5MbMEeVnq6n4", | |
"name": "Clientastic for iOS", | |
"link": "http://app.net" | |
}, | |
"machine_only": false, | |
"reply_to": null, | |
"thread_id": "1", | |
"num_replies": 3, | |
"num_reposts": 0, | |
"num_stars": 0, | |
"entities": { | |
"mentions": [{ | |
"name": "berg", | |
"id": "2", | |
"pos": 0, | |
"len": 5 | |
}], | |
"hashtags": [{ | |
"name": "newsocialnetwork", | |
"pos": 34, | |
"len": 17 | |
}], | |
"links": [{ | |
"text": "this new site", | |
"url": "https://join.app.net" | |
"pos": 20, | |
"len": 13 | |
}] | |
}, | |
"you_reposted": false, | |
"you_starred": false | |
}, | |
"meta": { | |
"code": 200, | |
} | |
} | |
</pre> | |
</li> | |
<li class="list-group-item bg-default response"> | |
<strong>Response <code>201</code></strong> | |
<a href="javascript:;" class="pull-right btn btn-default btn-sm snippet-toggle" data-target="response-snippet"><small>SHOW</small></a> | |
</li> | |
<li class="list-group-item response-snippet" style="list-style: none"> | |
<code>< Content-Type: application/json</code><br> | |
<pre class="prettyprint">{ | |
"data": { | |
"id": "1", // note this is a string | |
"user": { | |
... | |
}, | |
"created_at": "2012-07-16T17:25:47Z", | |
"text": "@berg FIRST post on this new site #newsocialnetwork", | |
"source": { | |
"client_id": "udxGzAVBdXwGtkHmvswR5MbMEeVnq6n4", | |
"name": "Clientastic for iOS", | |
"link": "http://app.net" | |
}, | |
"machine_only": false, | |
"reply_to": null, | |
"thread_id": "1", | |
"num_replies": 3, | |
"num_reposts": 0, | |
"num_stars": 0, | |
"entities": { | |
"mentions": [{ | |
"name": "berg", | |
"id": "2", | |
"pos": 0, | |
"len": 5 | |
}], | |
"hashtags": [{ | |
"name": "newsocialnetwork", | |
"pos": 34, | |
"len": 17 | |
}], | |
"links": [{ | |
"text": "this new site", | |
"url": "https://join.app.net" | |
"pos": 20, | |
"len": 13 | |
}] | |
}, | |
"you_reposted": false, | |
"you_starred": false | |
}, | |
"meta": { | |
"code": 200, | |
} | |
} | |
</pre> | |
</li> | |
</ul> | |
</div> | |
<div class="panel panel-info"> | |
<div class="panel-heading"> | |
<span class="btn btn-primary">GET</span> | |
<code>/stream/0/posts</code> | |
</div> | |
<div class="panel-body"> | |
<p>Retrieves all posts.</p> | |
</div> | |
<ul class="list-group"> | |
<li class="list-group-item bg-default response"> | |
<strong>Response <code>200</code></strong> | |
<a href="javascript:;" class="pull-right btn btn-default btn-sm snippet-toggle" data-target="response-snippet"><small>SHOW</small></a> | |
</li> | |
<li class="list-group-item response-snippet" style="list-style: none"> | |
<code>< Content-Type: application/json</code><br> | |
<pre class="prettyprint">{ | |
["data": { | |
"id": "1", // note this is a string | |
"user": { | |
... | |
}, | |
"created_at": "2012-07-16T17:25:47Z", | |
"text": "@berg FIRST post on this new site #newsocialnetwork", | |
"source": { | |
"client_id": "udxGzAVBdXwGtkHmvswR5MbMEeVnq6n4", | |
"name": "Clientastic for iOS", | |
"link": "http://app.net" | |
}, | |
"machine_only": false, | |
"reply_to": null, | |
"thread_id": "1", | |
"num_replies": 3, | |
"num_reposts": 0, | |
"num_stars": 0, | |
"entities": { | |
"mentions": [{ | |
"name": "berg", | |
"id": "2", | |
"pos": 0, | |
"len": 5 | |
}], | |
"hashtags": [{ | |
"name": "newsocialnetwork", | |
"pos": 34, | |
"len": 17 | |
}], | |
"links": [{ | |
"text": "this new site", | |
"url": "https://join.app.net" | |
"pos": 20, | |
"len": 13 | |
}] | |
}, | |
"you_reposted": false, | |
"you_starred": false | |
}, | |
"meta": { | |
"code": 200, | |
}], | |
... | |
} | |
</pre> | |
</li> | |
</ul> | |
</div> | |
<div class="panel panel-info"> | |
<div class="panel-heading"> | |
<span class="btn btn-success">POST</span> | |
<code>/stream/0/posts/{post_id}/star</code> | |
</div> | |
<div class="panel-body"> | |
<p>Save a given Post to the current User’s stars. This is just a “save” action, not a sharing action.</p> | |
<p><em>Note: A repost cannot be starred. Please star the parent Post.</em></p> | |
</div> | |
<ul class="list-group"> | |
<li class="list-group-item bg-default"><strong>Parameters</strong></li> | |
<li class="list-group-item"> | |
<dl class="dl-horizontal"> | |
<dt>post_id</dt> | |
<dd> | |
<strong>(required)</strong> | |
<code>string</code> The id of the Post. | |
</dd> | |
</dl> | |
</li> | |
<li class="list-group-item bg-default response"> | |
<strong>Response <code>200</code></strong> | |
<a href="javascript:;" class="pull-right btn btn-default btn-sm snippet-toggle" data-target="response-snippet"><small>SHOW</small></a> | |
</li> | |
<li class="list-group-item response-snippet" style="list-style: none"> | |
<code>< Content-Type: application/json</code><br> | |
<pre class="prettyprint">{ | |
"data": { | |
"id": "1", // note this is a string | |
"user": { | |
... | |
}, | |
"created_at": "2012-07-16T17:25:47Z", | |
"text": "@berg FIRST post on this new site #newsocialnetwork", | |
"source": { | |
"client_id": "udxGzAVBdXwGtkHmvswR5MbMEeVnq6n4", | |
"name": "Clientastic for iOS", | |
"link": "http://app.net" | |
}, | |
"machine_only": false, | |
"reply_to": null, | |
"thread_id": "1", | |
"num_replies": 3, | |
"num_reposts": 0, | |
"num_stars": 0, | |
"entities": { | |
"mentions": [{ | |
"name": "berg", | |
"id": "2", | |
"pos": 0, | |
"len": 5 | |
}], | |
"hashtags": [{ | |
"name": "newsocialnetwork", | |
"pos": 34, | |
"len": 17 | |
}], | |
"links": [{ | |
"text": "this new site", | |
"url": "https://join.app.net" | |
"pos": 20, | |
"len": 13 | |
}] | |
}, | |
"you_reposted": false, | |
"you_starred": false | |
}, | |
"meta": { | |
"code": 200, | |
} | |
} | |
</pre> | |
</li> | |
</ul> | |
</div> | |
<div class="panel panel-info"> | |
<div class="panel-heading"> | |
<span class="btn btn-danger">DELETE</span> | |
<code>/stream/0/posts/{post_id}/star</code> | |
</div> | |
<div class="panel-body"> | |
<p>Remove a Star from a Post.</p> | |
</div> | |
<ul class="list-group"> | |
<li class="list-group-item bg-default"><strong>Parameters</strong></li> | |
<li class="list-group-item"> | |
<dl class="dl-horizontal"> | |
<dt>post_id</dt> | |
<dd> | |
<strong>(required)</strong> | |
<code>string</code> The id of the Post. | |
</dd> | |
</dl> | |
</li> | |
<li class="list-group-item bg-default response"> | |
<strong>Response <code>200</code></strong> | |
<a href="javascript:;" class="pull-right btn btn-default btn-sm snippet-toggle" data-target="response-snippet"><small>SHOW</small></a> | |
</li> | |
<li class="list-group-item response-snippet" style="list-style: none"> | |
<code>< Content-Type: application/json</code><br> | |
<pre class="prettyprint">{ | |
"data": { | |
"id": "1", // note this is a string | |
"user": { | |
... | |
}, | |
"created_at": "2012-07-16T17:25:47Z", | |
"text": "@berg FIRST post on this new site #newsocialnetwork", | |
"source": { | |
"client_id": "udxGzAVBdXwGtkHmvswR5MbMEeVnq6n4", | |
"name": "Clientastic for iOS", | |
"link": "http://app.net" | |
}, | |
"machine_only": false, | |
"reply_to": null, | |
"thread_id": "1", | |
"num_replies": 3, | |
"num_reposts": 0, | |
"num_stars": 0, | |
"entities": { | |
"mentions": [{ | |
"name": "berg", | |
"id": "2", | |
"pos": 0, | |
"len": 5 | |
}], | |
"hashtags": [{ | |
"name": "newsocialnetwork", | |
"pos": 34, | |
"len": 17 | |
}], | |
"links": [{ | |
"text": "this new site", | |
"url": "https://join.app.net" | |
"pos": 20, | |
"len": 13 | |
}] | |
}, | |
"you_reposted": false, | |
"you_starred": false | |
}, | |
"meta": { | |
"code": 200, | |
} | |
} | |
</pre> | |
</li> | |
</ul> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> | |
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script> | |
<script> | |
jQuery(function($) { | |
$('#group-tab a:first').tab('show'); | |
$('.snippet-toggle').on("click", function(e) { | |
e.preventDefault(); | |
var target = $(this).data('target'); | |
$(this).parent().parent().find('.' + target).toggle(); | |
if ($(this).text() == "SHOW") { | |
$(this).text("HIDE"); | |
} else { | |
$(this).text("SHOW"); | |
} | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment