Skip to content

Commit d9a02a5

Browse files
author
Camilo A. Sampedro Restrepo
committed
Transferring API Description file from Apiary.io
1 parent 10c8891 commit d9a02a5

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

apiary.apib

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
FORMAT: 1A
2+
HOST: http://polls.apiblueprint.org/
3+
4+
# Polls API
5+
6+
Polls is a simple API allowing consumers to view polls and vote in them.
7+
8+
## Questions Collection [/questions]
9+
10+
### List All Questions [GET]
11+
12+
+ Response 200 (application/json)
13+
14+
[
15+
{
16+
"question": "Favourite programming language?",
17+
"published_at": "2015-08-05T08:40:51.620Z",
18+
"choices": [
19+
{
20+
"choice": "Swift",
21+
"votes": 2048
22+
}, {
23+
"choice": "Python",
24+
"votes": 1024
25+
}, {
26+
"choice": "Objective-C",
27+
"votes": 512
28+
}, {
29+
"choice": "Ruby",
30+
"votes": 256
31+
}
32+
]
33+
}
34+
]
35+
36+
### Create a New Question [POST]
37+
38+
You may create your own question using this action. It takes a JSON
39+
object containing a question and a collection of answers in the
40+
form of choices.
41+
42+
+ Request (application/json)
43+
44+
{
45+
"question": "Favourite programming language?",
46+
"choices": [
47+
"Swift",
48+
"Python",
49+
"Objective-C",
50+
"Ruby"
51+
]
52+
}
53+
54+
+ Response 201 (application/json)
55+
56+
+ Headers
57+
58+
Location: /questions/2
59+
60+
+ Body
61+
62+
{
63+
"question": "Favourite programming language?",
64+
"published_at": "2015-08-05T08:40:51.620Z",
65+
"choices": [
66+
{
67+
"choice": "Swift",
68+
"votes": 0
69+
}, {
70+
"choice": "Python",
71+
"votes": 0
72+
}, {
73+
"choice": "Objective-C",
74+
"votes": 0
75+
}, {
76+
"choice": "Ruby",
77+
"votes": 0
78+
}
79+
]
80+
}

0 commit comments

Comments
 (0)