Read poll results
Read how many times each option was chosen, so your application can display live results without downloading individual responses.
Read the results
Section titled “Read the results”GET /api/v1/tests/{test_key}/results
Request fields
Section titled “Request fields”| Field | Type | Required | Meaning |
|---|---|---|---|
test_key (path) |
string | Yes | The test’s key |
Request
Section titled “Request”curl --fail-with-body \ 'https://app.redjade.net/api/v1/tests/community-poll/results' \ --header "Authorization: Bearer $REDJADE_TOKEN"Response
Section titled “Response”{ "context": { "test": { "key": "community-poll", "name": "Community poll" } }, "questionnaires": [ { "key": "purchase-poll", "name": "Purchase intent", "participants": 120, "repetitions": 120, "questions": [ { "key": "purchase-intent", "type": "choice", "exclusive": true, "text": "Would you buy this product?", "answered": 120, "options": [ { "key": "yes", "name": "Yes", "count": 78, "percent": 65.0 }, { "key": "no", "name": "No", "count": 42, "percent": 35.0 } ] } ] } ]}To receive the same results in the response to a vote, add include=results when you send the response.
| Field | Type | Meaning |
|---|---|---|
questionnaires[].participants |
integer | Number of different participants with at least one repetition |
questionnaires[].repetitions |
integer | Number of repetitions |
questions[].answered |
integer | Number of repetitions with a response to this question |
options[].count |
integer | Number of repetitions that selected the option |
options[].percent |
number or null | count divided by answered, times 100, to one decimal place. null when answered is zero. |
Every option of the question appears, including options with a count of zero.
How responses are counted
Section titled “How responses are counted”- Each repetition counts once. A member who votes with two repetition keys counts twice in
repetitionsand once inparticipants. - A replaced repetition counts with its current response. Changing a vote moves the count from one option to the other.
- A repetition in which the question was not presented or not answered is left out of
answered. - On a question that is not exclusive, a repetition counts toward every option it selected. The percentages can add up to more than 100.
The results reflect every request RedJade has accepted, including one that returned a moment earlier.
What is included
Section titled “What is included”Results cover choice questions. Other question types do not appear in questions. Read individual responses with Read responses and definitions or Download study data.