# Simple voting API ## Common Response ```json= { "msg": String, "code": 1 success; 0 error, "data": Response data, "status": "success" or "error" } ``` ## GET (All) | Item | Value | | ------ | ---------- | | Method | GET | | path | **/votes** | | param | |  ## GET (One) | Item | Value | | ------ | ------------- | | Method | GET | | path | **/vote/:id** | | param | required |  ## POST | Item | Value | | ------ | --------- | | Method | POST | | path | **/vote** | | param | optional | ```json= { "title": "Do you agree everyone should have the right to drink soda?" } ```  ## PATCH | Item | Value | | ------ | --------- | | Method | PATCH | | path | **/vote** | | param | required | ```json= { "id":"ab1UunUVvHTVcGGEoe1Br", // vote id => required "title: "Hi everyone", // modify the tile => optional "option" : "win" // either "win", "lose", "draw" => required } ```  ## DELETE | Item | Value | | ------ | ------------- | | Method | DELETE | | path | **/vote/:id** | | param | required | - You can list vote ids in the whitelist in **db.json** if you want to prevent certain ids from being deleted.  ## Note - Whitelist 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up