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 : Edit Poll

Check the Polls App.

End Point

METHOD : PUT

http://mocker.in/api/polls/POLL_ID/EDIT_PASSWORD/edit

POLL_ID and EDIT_PASSWORD should be replaced with your actual poll data.

Minimum Required Parameters

{
    "slug": "PNZfsIK",
    "question": "dsfsdf",
    "options": {
        "1": "sdf",
        "2": "sdf",
        "3": "sdf",
        "4": "sdf"
    },
    "responses": {
        "1": 0,
        "2": 0,
        "3": 0,
        "4": 0
    },
    "is_active": true,
    "multiple_answers": false,
    "user_password": null,
    "active_from": null,
    "active_till": null,
    "edit_password": "33GcPAsapJz7"
}

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. other fields may be set if required.

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 updated successfully.",
    "data": {
        "slug": "drfgt33",
        "edit_password": "33GcPddApJz7",
        "question": "What is his name ok?",
        "options": [
            {
                "1": "Test",
                "2": "Test1",
                "3": "Test2",
                "4": "Test3"
            }
        ],
        "responses": null,
        "user_password": null,
        "active_from": null,
        "active_till": null,
        "is_active": true,
        "created_at": "2020-05-27T21:24:25.000000Z",
        "updated_at": "2020-05-27T21:30:58.000000Z",
        "multiple_answers": false
    }
}

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. The data field contains the complete details.

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