-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapiary.apib
78 lines (63 loc) · 1.95 KB
/
apiary.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
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# evolAPI
Polls is a simple API allowing consumers to view polls and vote in them.
## Questions Collection [/questions]
### List All Questions [GET]
+ Response 200 (application/json)
[
{
"question": "Favourite Machine Learning language?",
"choices": [
{
"choice": "Matlab",
"votes": 2048
}, {
"choice": "Python",
"votes": 1024
}, {
"choice": "R",
"votes": 512
}, {
"choice": "TensorFlow",
"votes": 256
}
]
}
]
### Create a New Question [POST]
You may create your own question using this action. It takes a JSON
object containing a question and a collection of answers in the
form of choices.
+ Request (application/json)
{
"question": "What is your Favourite Machine Learning language?",
"choices": [
"Matlab",
"Python",
"R,
"TensorFlow"
]
}
+ Response 201 (application/json)
+ Headers
Location: /questions/2
+ Body
{
"question": "What is your Favourite Machine Learning language?",
"choices": [
{
"choice": "Matlab",
"votes": 0
}, {
"choice": "Python",
"votes": 0
}, {
"choice": "R",
"votes": 0
}, {
"choice": "TensorFlow",
"votes": 0
}
]
}