Mocker Apps

Mocker Apps

  • Docs
  • API
  • Issues
  • Blog

›Polls API

Url Shortner API

  • Create
  • View
  • Edit
  • Delete

Clipboard API

  • Create
  • View
  • Edit
  • Delete

Polls API

  • Create
  • View
  • Edit
  • Delete

API : Create New Poll

Check the Polls App.

End Point

METHOD : POST

https://mocker.in/api/polls

Minimum Required Parameters

{
    
    "question" : "What is his name ok?",
    "options" : {
        "1":"Test",
        "2":"Test1",
        "3":"Test2",
        "4":"Test3"
    }
}

Above parameters are required fields. question field is where you can put your question of the poll. options is an array with key : value pair for each option you want the poll to have. These are the only two parameters required. slug or Poll ID will be generated automatically.

All Parameters

{
    "slug" : "fty6h",
    "question" : "What is his name ok?",
    "options" : {
        "1":"Test",
        "2":"Test1",
        "3":"Test2",
        "4":"Test3"
    },
    "user_password": "1234",
    "edit_password": "123456",
    "active_from": "23-03-2020 04:45 AM",
    "active_till": "28-03-2020 04:45 AM",
    "is_active": true,
    "multiple_answers": false
}

Above is the completely list of parameters. slug can be provided if you want a custom poll url. The slug value will decide the URL of your poll. https://mocker.in/p/{slug}. user_password is different from edit_password. user_password is the password that your participants will have to enter to submit votes. Whereas edit_password is required to edit the poll in future. It is very important to store this somewhere. active_from and active_till is used to enable the poll only at a specific duration. is_active if set to true will enable poll responses. but if it is set to false then users will not be able to submit their votes. Finally multiple_answers if set to false then only one option will be allowed to be selected from the options during voting, whereas if it is true then they can select multiple options.

Response

{
    "status": "success",
    "message": "Your poll created successfully.",
    "data": {
        "id": "erssr1",
        "edit_password": "asdasver",
        "poll_url": "https://mocker.in/p/erssr1",
        "results_url": "https://mocker.in/p/erssr1/results"
    }
}

The reponse will always return two parameters, status and message. If status is success then the action is complete. and if it is error then that means some problem has occured. The problem details can be found in the message parameter. Additionally creating a new poll returns the id,edit_password,poll_url and 'results_url' inside the data parameter. Once you have the id and edit_password you may get the complete details of the poll and also edit it.

← DeleteView →
  • End Point
    • Minimum Required Parameters
    • All Parameters
    • Response
Mocker Apps
Docs
URL ShortnerPolls
API
URL ShortnerPolls
More
BlogGitHub RepoStarContact Developer
Copyright © 2020 Shiburaj