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.

import { Mailblastr } from 'mailblastr';

const mb = new Mailblastr('mb_xxxxxxxxx');

const { data, error } = await mb.polls.get('8f2e4a3b-dfbc-4e9a-8b2c-5f3a1d6e7c8d');
console.log({ data, error });

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.