Surveys

Get survey results

Returns the tallied answers for a survey, broken down per question, along with how many of the eligible respondents replied. Requires the hoa_surveys:read permission.

GET
https://services.magicdoor.com/hoa/company-portal/associations/surveys/{surveyId}/results

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Path parameters

surveyIdstringrequired

The survey to act on.

example: 1830472847398410240

Response

200 · The tallied results.

surveyIdstring

The survey these results belong to.

titlestring

The survey's title.

statusstring

Where the survey has got to.

DraftOpenClosed
eligibleCountinteger

How many people were recorded as eligible when the survey was published. 0 for a CommunityMembers survey and for anything still in draft, because no eligible list is kept for those.

responseCountinteger

How many distinct owners answered at least one question.

responseRatenumber

responseCount divided by eligibleCount, as a fraction between 0 and 1 — 0.67 is 67%. Exactly 0 whenever eligibleCount is 0.

questionsobject[]

One entry per question, sorted by order. Which fields are filled in depends on the question's type.

401 · The bearer token is missing, expired, or not valid.

403 · The token is valid but the caller does not hold the `hoa_surveys:read` permission.

404 · No survey with that id belongs to the calling company.

Readable at any point

There is no state restriction — you can read results while the survey is still Open to watch answers arrive. A survey that was never published has no answers, so every count comes back as 0 and questions is empty.

Each entry in questions only carries the fields that make sense for its type, and the rest are absent rather than zero:

TypeFields you get
YesNoyesCount, noCount
MultipleChoiceoptions, one row per option including the unpicked ones
FreeTextresponseCount and responses, the answers themselves

skippedCount is on every entry. It is the number of people who took part in the survey but left this question unanswered, so it can only ever be as large as responseCount at the top level.

Free-text answers are not anonymous

responses names the owner behind every typed answer through ownerId. If you show survey results to the community, strip it first.