-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3829869
Showing
29 changed files
with
2,285 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
_site/ | ||
.sass-cache/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
title: /books | ||
type: get | ||
description: List all books | ||
parameters: | ||
title: List Book Format | ||
data: | ||
- offset: | ||
- integer | ||
- Offset the results by this amount | ||
- limit: | ||
- integer | ||
- Limit the number of books returned | ||
right_code: | ||
return: | | ||
[ | ||
{ | ||
"id": 1, | ||
"title": "The Hunger Games", | ||
"score": 4.5, | ||
"date_added": "12/12/2013" | ||
}, | ||
{ | ||
"id": 1, | ||
"title": "The Hunger Games", | ||
"score": 4.7, | ||
"date_added": "15/12/2013" | ||
}, | ||
] | ||
--- | ||
|
||
<p> Lists all the photos you have access to. You can paginate by using the parameters listed above. </p> | ||
|
||
<div class="code-viewer"> | ||
<pre data-language="jQuery"> | ||
$.get('http://api.myapp.com/books/', { token: 'YOUR_APP_KEY'}, function(data) { | ||
alert(data); | ||
});</pre> | ||
|
||
<pre data-language="Python"> | ||
r = requests.get('http://api.myapp.com/books/', token="YOUR_APP_KEY") | ||
print r.text</pre> | ||
|
||
<pre data-language="Node"> | ||
var request = require('request'); | ||
request('http://api.myapp.com/books?token=YOUR_APP_KEY', function (error, response, body) { | ||
if (!error && response.statusCode == 200) { | ||
console.log(body); | ||
} | ||
})</pre> | ||
|
||
<pre data-language="cURL"> | ||
curl http://sampleapi.readme.com/orders?key=YOUR_APP_KEY</pre> | ||
|
||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: /books | ||
type: post | ||
description: Create Book | ||
parameters: | ||
title: Create Book Format | ||
data: | ||
- title: | ||
- string | ||
- The title for the book | ||
- score: | ||
- float | ||
- The book's score between 0 and 5 | ||
right_code: | ||
response: | | ||
{ | ||
"id": 3, | ||
"title": "The Book Thief", | ||
"score": 4.3, | ||
"date_added": "5/1/2015" | ||
} | ||
--- | ||
|
||
Adds a book to your collection. | ||
|
||
<div class="code-viewer"> | ||
<pre data-language="jQuery"> | ||
$.post('http://api.myapp.com/books/', { | ||
token: 'YOUR_APP_KEY', | ||
title: "The Book Thief", | ||
score: 4.3 | ||
}, function(data) { | ||
alert(data); | ||
});</pre> | ||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: /books/:id | ||
type: get | ||
description: Get Book | ||
right_code: | ||
response: | | ||
{ | ||
"id": 3, | ||
"title": "The Book Thief", | ||
"score": 4.3, | ||
"date_added": "5/1/2015" | ||
} | ||
--- | ||
|
||
Returns a specific book from your collection | ||
|
||
<div class="code-viewer"> | ||
<pre data-language="jQuery"> | ||
$.get('http://api.myapp.com/books/3', { | ||
token: 'YOUR_APP_KEY', | ||
}, function(data) { | ||
alert(data); | ||
});</pre> | ||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
title: /books/:id | ||
type: put | ||
description: Update Book | ||
parameters: | ||
title: Update Book Format | ||
data: | ||
- title: | ||
- string | ||
- The title for the book | ||
- score: | ||
- float | ||
- The book's score between 0 and 5 | ||
right_code: | ||
response: | | ||
{ | ||
"id": 3, | ||
"title": "The Book Stealer", | ||
"score": 5, | ||
"date_added": "5/1/2015" | ||
} | ||
--- | ||
|
||
Update an existing book in your collection. | ||
|
||
<div class="code-viewer"> | ||
<pre data-language="jQuery"> | ||
$.ajax({ | ||
url: 'http://api.myapp.com/books/3' | ||
type: 'PUT', | ||
data: { | ||
token: 'YOUR_APP_KEY', | ||
score: 5.0, | ||
title: "The Book Stealer" | ||
}, | ||
success: function(data) { | ||
alert(data); | ||
});</pre> | ||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
title: /books/:id | ||
type: delete | ||
description: Deletes a book | ||
right_code: | ||
response: | | ||
{ | ||
"id": 3, | ||
"status": "deleted" | ||
} | ||
--- | ||
Deletes a book in your collection. | ||
|
||
<div class="code-viewer"> | ||
<pre data-language="jQuery"> | ||
$.ajax({ | ||
url: 'http://api.myapp.com/books/3' | ||
type: 'DELETE', | ||
data: { | ||
token: 'YOUR_APP_KEY' | ||
}, | ||
success: function(data) { | ||
alert(data); | ||
});</pre> | ||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
collections: | ||
documentation: | ||
title: Documentation | ||
render: true | ||
api: | ||
title: APIs | ||
render: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: Getting Started | ||
description: An intro to our API | ||
right_code: | ||
--- | ||
|
||
|
||
<p> Welcome to our API! </p> | ||
|
||
<p> This API document is designed for those interested in developing for our platform. </p> | ||
|
||
<div class="warning message-box"> | ||
<h5>Warning</h5> | ||
|
||
<p> Something terrible will happen if you try and do this. </p> | ||
</div> | ||
|
||
<p> This API is still under development and will evolve. </p> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: Authentication | ||
right_code: | ||
jQuery: | | ||
$.get('http://api.myapp.com/books/', { token: 'YOUR_APP_KEY'}, function(data) { | ||
alert(data); | ||
}); | ||
cURL: | | ||
curl http://api.myapp.com/books?token=YOUR_APP_KEY | ||
--- | ||
|
||
<p> You need to be authenticated for all API requests. You can generate an API key in your developer dashboard. </p> | ||
|
||
<p> Add the API key to all requests as a GET parameter. </p> | ||
|
||
<div class="alert message-box"> | ||
<h5>Uh ohhh</h5> | ||
|
||
<p>Nothing will work unless you include this API key.</p> | ||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: Errors | ||
description: These are all the errors the API could return | ||
|
||
--- | ||
<table class="return_codes"> | ||
<thead> | ||
<tr> | ||
<th>Code</th> | ||
<th>Name</th> | ||
<th>Description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td><span class="return-code">200</span></td> | ||
<td>OK</td> | ||
<td>Success</td> | ||
</tr> | ||
<tr> | ||
<td><span class="return-code">201</span></td> | ||
<td>Created</td> | ||
<td>Creation successful</td> | ||
</tr> | ||
|
||
<tr> | ||
<td><span class="return-code">400</span></td> | ||
<td>Bad Request</td> | ||
<td>We could not process that action</td> | ||
</tr> | ||
|
||
<tr> | ||
<td><span class="return-code">403</span></td> | ||
<td>Forbidden</td> | ||
<td>We couldn't authenticate you</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<p> All errors will return JSON in the following format: </p> | ||
|
||
<pre> | ||
{ | ||
error: true, | ||
message: "error message here" | ||
}</pre> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<div id="sidebar" class="sidebar"> | ||
{% for collection in site.collections %} | ||
{% if collection[1].render %} | ||
<section> | ||
<h6> {{collection[1].title}} </h6> | ||
<ul> | ||
{% for doc in collection[1].docs %} | ||
<li><a href="#{{doc.url | replace: '/', '' | replace: '.', ''}}"> | ||
{{doc.title}} | ||
{% if doc.type %}<span class="endpoint {{doc.type}}"></span> {% endif %} | ||
</a></li> | ||
{% endfor %} | ||
</ul> | ||
</section> | ||
{% endif %} | ||
{% endfor %} | ||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>{{page.title}}</title> | ||
<link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css"> | ||
<link rel="stylesheet" href="css/normalize.css"> | ||
<link rel="stylesheet" href="css/style.css"> | ||
<!-- <link rel="icon" type="image/png" href="images/favicon.png"> --> | ||
|
||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | ||
<script src="/js/main.js"></script> | ||
|
||
<link rel="stylesheet" href="/css/tomorrow.css"> | ||
<link rel="stylesheet" href="/css/railscasts.css"> | ||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script> | ||
</head> | ||
<body class="{{page.body_class}}"> | ||
|
||
<nav class="nav-bar"> | ||
<ul class="hor"> | ||
<li> <a href="/" class="logo"><img src="/img/log.png" alt="logo" height="20" /></a> </li> | ||
{% assign current = page.url %} | ||
<li> <a href="/" | ||
{% if current == '/index.html' %} | ||
class="current" | ||
{% endif %} | ||
> Documentation </a> </li> | ||
<li> <a href="/index2.html" | ||
{% if current == '/index2.html' %} | ||
class="current" | ||
{% endif %} | ||
> 2nd layout </a> </li> | ||
</ul> | ||
|
||
<ul class="right hor"> | ||
<li><input type="text" name="search" id="search" class="search-box" placeholder="Search"><div id="search_results" class="search-results"></div></li> | ||
|
||
</ul> | ||
</nav> | ||
{% if page.sidebar %} | ||
{% include sidebar.html %} | ||
{% endif %} | ||
<div class="main"> | ||
{{content}} | ||
</div> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
name: Twitter (@orderapi) | ||
link: '#' | ||
--- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
name: Email ([email protected]) | ||
link: '#' | ||
--- |
Oops, something went wrong.