diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-03-18 16:24:05 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-03-18 16:24:05 +0100 |
commit | 169d60abc7e0ee191bfb66ecb1fbbac14ab88095 (patch) | |
tree | 26e95836134acbf0e462aa3817cf0ceb7297bf69 /apiary.apib | |
parent | f39e94ace35c2a30e2079706bb3d27d8a16c91ec (diff) | |
download | wallabag-169d60abc7e0ee191bfb66ecb1fbbac14ab88095.tar.gz wallabag-169d60abc7e0ee191bfb66ecb1fbbac14ab88095.tar.zst wallabag-169d60abc7e0ee191bfb66ecb1fbbac14ab88095.zip |
Transferring API Description file from Apiary.io
Diffstat (limited to 'apiary.apib')
-rw-r--r-- | apiary.apib | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/apiary.apib b/apiary.apib new file mode 100644 index 00000000..cd355a1e --- /dev/null +++ b/apiary.apib | |||
@@ -0,0 +1,80 @@ | |||
1 | FORMAT: 1A | ||
2 | HOST: http://polls.apiblueprint.org/ | ||
3 | |||
4 | # wallabag | ||
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 | } \ No newline at end of file | ||