forked from bep/docuapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break down example site to smaller md files
- Loading branch information
Showing
3 changed files
with
155 additions
and
147 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,71 @@ | ||
--- | ||
weight: 12 | ||
title: Get a Specific Kitten | ||
--- | ||
|
||
## Get a Specific Kitten | ||
|
||
```go | ||
package main | ||
|
||
import "github.com/bep/kittn/auth" | ||
|
||
func main() { | ||
api := auth.Authorize("meowmeowmeow") | ||
|
||
_ = api.GetKitten(2) | ||
} | ||
``` | ||
|
||
```ruby | ||
require 'kittn' | ||
|
||
api = Kittn::APIClient.authorize!('meowmeowmeow') | ||
api.kittens.get(2) | ||
``` | ||
|
||
```python | ||
import kittn | ||
|
||
api = kittn.authorize('meowmeowmeow') | ||
api.kittens.get(2) | ||
``` | ||
|
||
```shell | ||
curl "http://example.com/api/kittens/2" | ||
-H "Authorization: meowmeowmeow" | ||
``` | ||
|
||
```javascript | ||
const kittn = require('kittn'); | ||
|
||
let api = kittn.authorize('meowmeowmeow'); | ||
let max = api.kittens.get(2); | ||
``` | ||
|
||
> The above command returns JSON structured like this: | ||
```json | ||
{ | ||
"id": 2, | ||
"name": "Max", | ||
"breed": "unknown", | ||
"fluffiness": 5, | ||
"cuteness": 10 | ||
} | ||
``` | ||
|
||
This endpoint retrieves a specific kitten. | ||
|
||
<aside class="warning">Inside HTML code blocks like this one, you can't use Markdown, so use <code><code></code> blocks to denote code.</aside> | ||
|
||
### HTTP Request | ||
|
||
`GET http://example.com/kittens/<ID>` | ||
|
||
### URL Parameters | ||
|
||
Parameter | Description | ||
--------- | ----------- | ||
ID | The ID of the kitten to retrieve | ||
|
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,84 @@ | ||
--- | ||
weight: 11 | ||
title: Kittens | ||
--- | ||
|
||
# Kittens | ||
|
||
## Get All Kittens | ||
|
||
```go | ||
package main | ||
|
||
import "github.com/bep/kittn/auth" | ||
|
||
func main() { | ||
api := auth.Authorize("meowmeowmeow") | ||
|
||
_ = api.GetKittens() | ||
} | ||
``` | ||
|
||
```ruby | ||
require 'kittn' | ||
|
||
api = Kittn::APIClient.authorize!('meowmeowmeow') | ||
api.kittens.get | ||
``` | ||
|
||
```python | ||
import kittn | ||
|
||
api = kittn.authorize('meowmeowmeow') | ||
api.kittens.get() | ||
``` | ||
|
||
```shell | ||
curl "http://example.com/api/kittens" | ||
-H "Authorization: meowmeowmeow" | ||
``` | ||
|
||
```javascript | ||
const kittn = require('kittn'); | ||
|
||
let api = kittn.authorize('meowmeowmeow'); | ||
let kittens = api.kittens.get(); | ||
``` | ||
|
||
> The above command returns JSON structured like this: | ||
```json | ||
[ | ||
{ | ||
"id": 1, | ||
"name": "Fluffums", | ||
"breed": "calico", | ||
"fluffiness": 6, | ||
"cuteness": 7 | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "Max", | ||
"breed": "unknown", | ||
"fluffiness": 5, | ||
"cuteness": 10 | ||
} | ||
] | ||
``` | ||
|
||
This endpoint retrieves all kittens. | ||
|
||
### HTTP Request | ||
|
||
`GET http://example.com/api/kittens` | ||
|
||
### Query Parameters | ||
|
||
Parameter | Default | Description | ||
--------- | ------- | ----------- | ||
include_cats | false | If set to true, the result will also include cats. | ||
available | true | If set to false, the result will include kittens that have already been adopted. | ||
|
||
<aside class="success"> | ||
Remember — a happy kitten is an authenticated kitten! | ||
</aside> |
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