Create poll

API to create a poll

Fields Information

Poll

Option

Creating a Poll

POST https://api.pollsapi.com/v1/create/poll

This endpoint allows you to get free cakes.

Headers

Request Body

{
  "status": "success",
  "statusCode": 200,
  "data": {
    "identifier": null,
    "question": "Do you like polls?",
    "data": {},
    "created_at": "2020-10-24T02:28:46.391Z",
    "updated_at": "2020-10-24T02:28:46.391Z",
    "id": "5f93915e7e044c74074f072e",
    "entity": "Poll",
    "options": [
      {
        "text": "Yes",
        "votes_count": 0,
        "data": {},
        "poll_id": "5f93915e7e044c74074f072e",
        "created_at": "2020-10-24T02:28:46.422Z",
        "updated_at": "2020-10-24T02:28:46.422Z",
        "id": "5f93915e7e044c74074f072f",
        "entity": "Option"
      },
      {
        "text": "No",
        "votes_count": 0,
        "data": {},
        "poll_id": "5f93915e7e044c74074f072e",
        "created_at": "2020-10-24T02:28:46.422Z",
        "updated_at": "2020-10-24T02:28:46.422Z",
        "id": "5f93915e7e044c74074f0730",
        "entity": "Option"
      }
    ]
  }
}

Example cURL request

curl -X POST \
  'https://api.pollsapi.com/v1/create/poll' \
  -H 'content-type: application/json' \
  -H "api-key: $API_KEY" \
  -d '
{
  "question": "Do you like polls?",
  "options": [
    {
      "text": "Yes"
    },
    {
      "text": "No"
    }
  ]
}
'

Request Body

{
    "question": "Does this doc help?",
    "identifier": "custom_identifier",
    "data": {
        "custom": "Poll Data"
    }
    "options": [
        {
            "text": "Option Text",
            "data": {
                "custom": "data"
            }
        },
        {
            "text": "Option Text2",
            "data": {
                "custom": "data"
            }
        }
    ]
}

Last updated