-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transferring API Description file from Apiary.io
- Loading branch information
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
FORMAT: 1A | ||
HOST: http://polls.apiblueprint.org/ | ||
|
||
# jira | ||
|
||
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 programming language?", | ||
"published_at": "2015-08-05T08:40:51.620Z", | ||
"choices": [ | ||
{ | ||
"choice": "Swift", | ||
"votes": 2048 | ||
}, { | ||
"choice": "Python", | ||
"votes": 1024 | ||
}, { | ||
"choice": "Objective-C", | ||
"votes": 512 | ||
}, { | ||
"choice": "Ruby", | ||
"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": "Favourite programming language?", | ||
"choices": [ | ||
"Swift", | ||
"Python", | ||
"Objective-C", | ||
"Ruby" | ||
] | ||
} | ||
|
||
+ Response 201 (application/json) | ||
|
||
+ Headers | ||
|
||
Location: /questions/2 | ||
|
||
+ Body | ||
|
||
{ | ||
"question": "Favourite programming language?", | ||
"published_at": "2015-08-05T08:40:51.620Z", | ||
"choices": [ | ||
{ | ||
"choice": "Swift", | ||
"votes": 0 | ||
}, { | ||
"choice": "Python", | ||
"votes": 0 | ||
}, { | ||
"choice": "Objective-C", | ||
"votes": 0 | ||
}, { | ||
"choice": "Ruby", | ||
"votes": 0 | ||
} | ||
] | ||
} |