API Reference

Retrieve Poll Results

GET /polls/:emailId — the aggregated answer breakdown for one email.

GET/polls/:emailId

Retrieve the aggregated poll results for a single email: a tally per answer (most-voted first, with each answer's share of all responses), the total number of responses, and the number of distinct respondents.

Path parameters
email_idstringrequired

The id of the email the poll was sent on.

const res = await fetch('https://api.mailblastr.com/polls/8f2e4a3b-dfbc-4e9a-8b2c-5f3a1d6e7c8d', {
  method: 'GET',
  headers: { 'Authorization': 'Bearer mb_xxxxxxxxx' },
});
const data = await res.json();
console.log(data);

Response

{
  "object": "poll_result",
  "email_id": "8f2e4a3b-dfbc-4e9a-8b2c-5f3a1d6e7c8d",
  "total": 128,
  "unique_respondents": 121,
  "answers": [
    { "answer": "Great", "count": 74, "pct": 57.8 },
    { "answer": "Okay", "count": 39, "pct": 30.5 },
    { "answer": "Poor", "count": 15, "pct": 11.7 }
  ]
}

A vote also emits a poll.responded automation event, so you can trigger a workflow (or branch on event.answer) when a contact responds.