##Restapi:
###Session Management
- /authenticate
- POST
- parameters: username, password
- example:
{"username"="brudi","password"="***"}
- example:
- returns
- success:
{"id":"1","user_name":"brudi","password":"***","real_name":"dave"}
- error:
{"auth":"false"}
- success:
- /isLoggedIn
- GET
- returns
- success:
{"auth":"true"}'
- error:
{"auth":"false"}
- success:
- /logout
- POST
- returns
- success:
{"isLoggedOut":"true"}
- error:
{"isLoggedOut":"false"}
- success:
- /polls
- GET
- returns
- success:
[[{"id":"1","title":"Mittag","User_id":"1"},{"voted":true}],[{"id":"2","title":"Code","User_id":"2"},{"voted":true}],[{"id":"3","title":"parrat?","User_id":"1"},{"voted":false}],
- error:
{"auth":"false"}
- success:
- /pollStat
- GET
- parameter: pollId
- example:
http://localhost/_PollrRestApiV2/pollr/pollStat?pollId=1
- example:
- returns
- success:
{"id":"1","title":"Mittag","User_id":"1","answers":[{"id":"1","name":"mac","Poll_id":"1"},{"id":"2","name":"kantine","Poll_id":"1"}]}
- error:
{"auth":"false"}
- success:
- /pollOptions
- GET
- parameter: pollId
- example:
http://localhost/_PollrRestApiV2/pollr/pollOptions?pollId=1
- example:
- returns
- success:
[{"id":"1","name":"mac","Poll_id":"1"},{"id":"2","name":"kantine","Poll_id":"1"}]
- error:
{"auth":"false"}
- success:
- /poll
- POST
- parameter: title
- example:
{"title":"poll Title","answers":[{"name":"mac"},{"name":"kantine"}]}
- example:
- returns
- success:
{"status":"OK","data":{"id":"19","title":"test","User_id":"1"}}
- error:
- unauthenticated:
{"auth":"false"}
- error by insertion:
{"status":"ERROR","messages":{"messageObject"}}
- unauthenticated:
- success:
- /pollOption
- POST
- parameter: name, pollId
- example:
{"name"="mac","pollId"="1"}
- example:
- returns
- success:
{"status":"OK","data":{"id":"6","name":"test","Poll_id":"19"}}
- error:
- unauthenticated:
{"auth":"false"}
- error by insertion:
{"status":"ERROR","messages":{"messageObject"}}
- unauthenticated:
- success:
- /vote
- POST
- parameter: answerId
- example:
{"answerId"="6"}
- example:
- returns:
- success:
{"status":"OK","data":{"Answer_id":"6","User_id":"1"}}
- error:
- unauthenticated:
{"auth":"false"}
- error by insertion:
{"status":"ERROR","messages":{"messageObject"}}
- unauthenticated:
- success:
- /pollOption -> not implemented
- DELETE
- optionId