This is the API documentation for the Polling App.
- URL:
/api/login
- Method: POST
- Parameters:
email
(string, required): user's emailpassword
(string, required): user's password
- URL:
/api/register
- Method: POST
- Parameters:
email
(string, required): user's emailpassword
(string, required): user's passwordconfirm_password
(string, required): confirm user's password
- URL:
/api/poll-store?token=*you-token*
- Method: POST
- Parameters:
title
(string, required): poll titlequestion
(string, required): poll questionanswers
(array, required): poll answersanswer
(string, required): answer optionvotes
(int): votes count (optional)
- URL:
/api/poll-update?token=*you-token*
- Method: POST
- Parameters:
poll_id
(int, required): poll ID to updatetitle
(string, required): poll titlequestion
(string, required): poll questionanswers
(array, required): poll answersanswer
(string, required): answer optionvotes
(int): votes count (optional)
- URL:
/api/poll-update-get?token=*you-token*
- Method: GET
- Parameters:
poll_id
(int, required): poll ID to get
- URL:
/api/poll-destroy?token=*you-token*
- Method: POST
- Parameters:
poll_id
(int, required): poll ID to destroy
- URL:
/api/get-random-poll?token=*you-token*
- Method: GET
- URL:
/api/poll-destroy-answer?token=*you-token*
- Method: POST
- Parameters:
answer_id
(int, required): answer ID to destroy
If an error occurs, the API will return a JSON response with the following format:
{
"error": {
"code": 404,
"message": "Resource not found"
}
}