# Get poll by Id

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

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

## Get Poll by Id

<mark style="color:blue;">`GET`</mark> `https://api.pollsapi.com/v1/get/poll/{poll_id}`

This endpoint allows you to fetch your poll by ID

#### Path Parameters

| Name     | Type   | Description             |
| -------- | ------ | ----------------------- |
| poll\_id | string | ID of the Poll to fetch |

#### Headers

| Name    | Type   | Description              |
| ------- | ------ | ------------------------ |
| api-key | string | API KEY for your account |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```javascript
{
  "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"
      }
    ]
  }
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{ 
    "status": "error", 
    "statusCode": 404, 
    "message": "Poll not found" 
}

```

{% endtab %}
{% endtabs %}

### Example cURL Request

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