Skip to content

Commit e5e78db

Browse files
author
Aurélien Malisart
committed
endpoint descriptions
1 parent 99e8e09 commit e5e78db

File tree

12 files changed

+437
-417
lines changed

12 files changed

+437
-417
lines changed

kittens.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Kittens
2+
3+
## Get All Kittens
4+
5+
```ruby
6+
require 'kittn'
7+
8+
api = Kittn::APIClient.authorize!('meowmeowmeow')
9+
api.kittens.get
10+
```
11+
12+
```python
13+
import kittn
14+
15+
api = kittn.authorize('meowmeowmeow')
16+
api.kittens.get()
17+
```
18+
19+
```shell
20+
curl "http://example.com/api/kittens"
21+
-H "Authorization: meowmeowmeow"
22+
```
23+
24+
```javascript
25+
const kittn = require('kittn');
26+
27+
let api = kittn.authorize('meowmeowmeow');
28+
let kittens = api.kittens.get();
29+
```
30+
31+
> The above command returns JSON structured like this:
32+
33+
```json
34+
[
35+
{
36+
"id": 1,
37+
"name": "Fluffums",
38+
"breed": "calico",
39+
"fluffiness": 6,
40+
"cuteness": 7
41+
},
42+
{
43+
"id": 2,
44+
"name": "Max",
45+
"breed": "unknown",
46+
"fluffiness": 5,
47+
"cuteness": 10
48+
}
49+
]
50+
```
51+
52+
This endpoint retrieves all kittens.
53+
54+
### HTTP Request
55+
56+
`GET http://example.com/api/kittens`
57+
58+
### Query Parameters
59+
60+
Parameter | Default | Description
61+
--------- | ------- | -----------
62+
include_cats | false | If set to true, the result will also include cats.
63+
available | true | If set to false, the result will include kittens that have already been adopted.
64+
65+
<aside class="success">
66+
Remember — a happy kitten is an authenticated kitten!
67+
</aside>
68+
69+
## Get a Specific Kitten
70+
71+
```ruby
72+
require 'kittn'
73+
74+
api = Kittn::APIClient.authorize!('meowmeowmeow')
75+
api.kittens.get(2)
76+
```
77+
78+
```python
79+
import kittn
80+
81+
api = kittn.authorize('meowmeowmeow')
82+
api.kittens.get(2)
83+
```
84+
85+
```shell
86+
curl "http://example.com/api/kittens/2"
87+
-H "Authorization: meowmeowmeow"
88+
```
89+
90+
```javascript
91+
const kittn = require('kittn');
92+
93+
let api = kittn.authorize('meowmeowmeow');
94+
let max = api.kittens.get(2);
95+
```
96+
97+
> The above command returns JSON structured like this:
98+
99+
```json
100+
{
101+
"id": 2,
102+
"name": "Max",
103+
"breed": "unknown",
104+
"fluffiness": 5,
105+
"cuteness": 10
106+
}
107+
```
108+
109+
This endpoint retrieves a specific kitten.
110+
111+
<aside class="warning">Inside HTML code blocks like this one, you can't use Markdown, so use <code>&lt;code&gt;</code> blocks to denote code.</aside>
112+
113+
### HTTP Request
114+
115+
`GET http://example.com/kittens/<ID>`
116+
117+
### URL Parameters
118+
119+
Parameter | Description
120+
--------- | -----------
121+
ID | The ID of the kitten to retrieve

source/includes/_authentication.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Authentication
2+
3+
A `api_key` parameter must be passed to all requests.
4+
5+
Parameter | Default
6+
--------- | -------
7+
api_key | null

source/includes/_contacts.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Contacts
2+
3+
## Get all contacts
4+
5+
This endpoint retrieves all contacts.
6+
7+
### HTTP Request
8+
9+
`GET /api/labs/:lab_id/contacts`
10+
11+
page
12+
13+
## Get a contact
14+
15+
This endpoint retrieves a specific contact.
16+
17+
### HTTP Request
18+
19+
`GET /api/labs/:lab_id/contacts/:id`
20+
21+
## Create a contact
22+
23+
This endpoint creates a new contact.
24+
25+
### HTTP Request
26+
27+
`POST /api/labs/:lab_id/contacts`
28+
29+
## Update a contact
30+
31+
This endpoint updates an existing contact.
32+
33+
### HTTP Request
34+
35+
`PUT /api/labs/:lab_id/contacts/:id`
36+
37+
## Delete a contact
38+
39+
This endpoint deletes an existing contact.
40+
41+
### HTTP Request
42+
43+
`DELETE /api/labs/:lab_id/contacts/:id`

source/includes/_errors.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

source/includes/_events.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Events
2+
3+
## Get all events
4+
5+
This endpoint retrieves all events.
6+
7+
### HTTP Request
8+
9+
`GET /api/labs/:lab_id/events`
10+
11+
page
12+
13+
## Get an event
14+
15+
This endpoint retrieves a specific event.
16+
17+
### HTTP Request
18+
19+
`GET /api/labs/:lab_id/events/:id`
20+
21+
## Get all events of a contact
22+
23+
This endpoint retrieves all events of a specific contact.
24+
25+
### HTTP Request
26+
27+
`GET /api/labs/:lab_id/contacts/:contact_id/events`
28+
29+
page
30+
31+
## Get an event of a contact
32+
33+
This endpoint retrieves a specific event of a specific contact.
34+
35+
### HTTP Request
36+
37+
`GET /api/labs/:lab_id/contacts/:contact_id/events/:id`

source/includes/_labs.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Labs
2+
3+
## Get all labs
4+
5+
This endpoint retrieves all labs.
6+
7+
### HTTP Request
8+
9+
`GET /api/labs`
10+
11+
### Query Parameters
12+
13+
Parameter | Default
14+
--------- | -------
15+
api_key | null
16+
17+
## Get one lab
18+
19+
This endpoint retrieves a specific lab.
20+
21+
### HTTP Request
22+
23+
`GET /api/labs/:id`
24+
25+
### Query Parameters
26+
27+
Parameter | Default
28+
--------- | -------
29+
api_key | null
30+
lab_id | null

source/includes/_organizations.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Organizations
2+
3+
## Get all organizations
4+
5+
This endpoint retrieves all organizations.
6+
7+
### HTTP Request
8+
9+
`GET /api/labs/:lab_id/organizations`
10+
11+
page
12+
13+
## Get an organization
14+
15+
This endpoint retrieves a specific organization.
16+
17+
### HTTP Request
18+
19+
`GET /api/labs/:lab_id/organizations/:id`
20+
21+
## Get all organizations of a contact
22+
23+
This endpoint retrieves all organizations of a specific contact.
24+
25+
### HTTP Request
26+
27+
`GET /api/labs/:lab_id/contacts/:contact_id/organizations`
28+
29+
page
30+
31+
## Get an organization of a contact
32+
33+
This endpoint retrieves a specific organization of a specific contact.
34+
35+
### HTTP Request
36+
37+
`GET /api/labs/:lab_id/contacts/:contact_id/organizations/:id`

source/includes/_permissions.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Permissions
2+
3+
## Get all permissions of a user
4+
5+
This endpoint retrieves all permissions of a user (for all his accessible labs).
6+
7+
### HTTP Request
8+
9+
`GET /api/users/:user_id/permissions`
10+
11+
## Get permissions of a user on a lab
12+
13+
This endpoint retrieves the permissions of a user on a lab.
14+
15+
### HTTP Request
16+
17+
`GET /api/users/:user_id/permissions/:lab_id`
18+
19+
## Grant a user access to a lab
20+
21+
This endpoint grants a user access to a lab.
22+
23+
### HTTP Request
24+
25+
`POST /api/users/:user_id/permissions/:lab_id`
26+
27+
## Update permissions of a user on a lab
28+
29+
This endpoint updates a user's permissions to a lab.
30+
31+
### HTTP Request
32+
33+
`PUT /api/users/:user_id/permissions/:lab_id`
34+
35+
## Revoke access of a user to a lab
36+
37+
This endpoint revokes a user's access to a lab.
38+
39+
### HTTP Request
40+
41+
`DELETE /api/users/:user_id/permissions/:lab_id`

source/includes/_projects.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Projects
2+
3+
## Get all projects
4+
5+
This endpoint retrieves all projects.
6+
7+
### HTTP Request
8+
9+
`GET /api/labs/:lab_id/projects`
10+
11+
page
12+
13+
## Get a project
14+
15+
This endpoint retrieves a specific project.
16+
17+
### HTTP Request
18+
19+
`GET /api/labs/:lab_id/projects/:id`
20+
21+
## Get all projects of a contact
22+
23+
This endpoint retrieves all projects of a specific contact.
24+
25+
### HTTP Request
26+
27+
`GET /api/labs/:lab_id/contacts/:contact_id/projects`
28+
29+
page
30+
31+
## Get a project of a contact
32+
33+
This endpoint retrieves a specific project of a specific contact.
34+
35+
### HTTP Request
36+
37+
`GET /api/labs/:lab_id/contacts/:contact_id/projects/:id`

0 commit comments

Comments
 (0)