-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhapiseed-blueprint.apib
101 lines (75 loc) · 2.26 KB
/
hapiseed-blueprint.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
FORMAT: 1A
# Polls API
A simple example of a REST API written in node with hapi
## index root [/]
### List All Endpoints [GET]
+ Response 200 (application/json; charset=utf-8)
{
"links": {
"self": "http://localhost:1337",
"greetings": "http://localhost:1337/greetings",
"documentation": "http://docs.hapiseed.apiary.io/"
}
}
## Greetings Collection [/greetings]
### List All Greetings [GET]
+ Response 200 (application/json; charset=utf-8)
[
{
"language": "en",
"greeting": "Hi there",
"url": "http://localhost:1337/greetings/en"
},
{
"language": "fr",
"greeting": "Bonjour",
"url": "http://localhost:1337/greetings/fr"
}
]
### create a greeting [POST]
+ Request (application/json; charset=utf-8)
{
"language": "us",
"greeting": "Howdy there!"
}
+ Response 202 (application/json; charset=utf-8)
{
"language": "us",
"greeting": "Howdy there!",
"url": "http://localhost:1337/greetings/us"
}
## View Single Greeting [/greetings/{language}]
### View Single Greeting [GET]
+ Parameters
+ language: us (required)
+ Response 200 (application/json; charset=utf-8)
{
"language": "us",
"greeting": "Howdy there!",
"url": "http://localhost:1337/greetings/us"
}
### Greeting not found [GET]
+ Parameters
+ language: foobar (required)
+ Response 404 (application/json; charset=utf-8)
{
"links": {
"documentation":"http://docs.hapiseed.apiary.io/"
},
"errors": [{
"status": "404",
"title": "Resource not found"
}]
}
## Route Not Found [/foobar]
### Get Request [GET]
+ Response 404 (application/json; charset=utf-8)
{
"links": {
"documentation":"http://docs.hapiseed.apiary.io/"
},
"errors": [{
"status": "404",
"title": "Resource not found"
}]
}