Get poll by Id

Endpoint to fetch a Poll by Id

You have a poll created, but how do you fetch it?

Well, this is the reason this endpoint exists😉. Just pass in the poll id that you want to retrieve and let the magic happen.

get
Get Poll by Id

https://api.pollsapi.com/v1/get/poll/{poll_id}
This endpoint allows you to fetch your poll by ID
Request
Response
Request
Path Parameters
poll_id
optional
string
ID of the Poll to fetch
Headers
api-key
required
string
API KEY for your account
Response
200: OK
Cake successfully retrieved.
{
"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"
}
]
}
}
404: Not Found
{
"status": "error",
"statusCode": 404,
"message": "Poll not found"
}

Example cURL Request

curl https://api.pollsapi.com/v1/get/poll/5f9f7b186477891e5bc646a1 \
-H "content-type: application/json" \
-H "api-key: $API_KEY"