/v1/communities/{community_id}/posts/{post_id}/poll-resultsAuthAggregate poll results for a post.
Returns counts per option, zero-filling options that received no votes, plus `total_votes`. The `question` and option `label` strings are echoed from `post.attributes.poll`.
Path parameters
community_id*stringCommunity UUID.
post_id*stringPost UUID containing the poll.
Response · 200 Aggregated poll results.
post_id*string · uuidPost UUID the poll lives on.
Example: "bbbbbbbb-0000-0000-0000-000000000001"
question*stringPoll question, copied from post.attributes.poll.question.
Example: "Best dev tool?"
options*arrayEach option with its vote count.
total_votes*numberSum of counts across every option.
Example: 67
Example
Request
GET https://social.productcraft.co/v1/communities/{community_id}/posts/{post_id}/poll-results
Authorization: Bearer YOUR_TOKENimport { Social } from "@productcraft/social";
// Reads PRODUCTCRAFT_API_KEY from the environment
const social = new Social();
const result = await social.community("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").posts.pollResults("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");social.community(…).posts.pollResults(postId, options?): Social.PollResultsResponse
Response
{
"post_id": "bbbbbbbb-0000-0000-0000-000000000001",
"question": "Best dev tool?",
"options": [
{
"index": 0,
"label": "VS Code",
"count": 42
}
],
"total_votes": 67
}