Note: Polls are currently supported within posts only. Standalone polls
will be available in future SDK versions.
Key Features
Flexible Answer Types
Support for single or multiple choice voting patterns
Time-Limited Voting
Set automatic poll expiration with customizable durations
Moderation Controls
Owner-only management capabilities for poll lifecycle
Create a Poll
Create engaging polls with customizable settings and up to 10 answer options.Configuration Options
Poll Structure
Poll Structure
| Parameter | Type | Description | Limits |
|-----------|------|-------------|---------| |
question | String | Poll
question text | Max 500 characters | | answers | Array | Available answer
options | 2-10 options, max 200 chars each |Poll Behavior
Poll Behavior
| Parameter | Type | Description | Limits |
|-----------|------|-------------|---------| |
answerType | Enum | Single
or multiple choice | Single (default), Multiple | | timeToClosePoll |
Number | Poll duration in seconds | Default: 30 days |Vote on Polls
Enable users to participate in polls with single or multiple choice voting.Parameters
Voting Parameters
Voting Parameters
pollId(String): The unique identifier of the poll -answerIds(Array<String>): IDs of selected answer options
Unvote on Polls
Allows users to remove their vote from a poll at any time before the poll closes.Parameters
Voting Parameters
Voting Parameters
pollId(String): The unique identifier of the poll -answerIds(Array<String>): IDs of selected answer options
Close Polls
Poll owners and administrators can manually close polls before their scheduled end time.Permissions: Only poll creators and administrators can close polls.
Delete Polls
Permanently remove polls from the system. This action cannot be undone.Best Practices
Poll Design
Poll Design
- Keep questions clear and concise (under 500 characters) - Provide 2-6 answer options for better user experience - Use descriptive answer text (avoid generic “Option 1”, “Option 2”) - Consider your audience when setting poll duration
User Experience
User Experience
- Indicate poll expiration time clearly - Provide visual feedback when votes are submitted - Handle edge cases (poll closed, already voted) - Show real-time vote counts when appropriate
Error Handling
Error Handling
- Check poll status before allowing votes - Validate user permissions for management actions - Provide clear error messages for failed operations - Implement retry logic for network failures
Performance
Performance
- Cache poll results to reduce API calls - Implement efficient polling for live updates - Consider pagination for polls with many votes - Optimize for mobile network conditions