data field to represent content types beyond text, image, video, and file, such as polls, location pins, booking widgets, or any app-specific structure.
Custom Message Overview
Custom messages use a free-form JSONdata field to represent any content type your application requires.
JSON Structure
JSON-based data format
- Free-form JSON object structure
- Support for nested objects and arrays
- Complex data type handling
- Schema validation capabilities
Interactive Content
Custom content types
- Surveys
- Location sharing and maps
- Booking and reservation widgets
- Custom UI components
Implementation Guide
- Basic Custom Messages
- Interactive Content
- Advanced Custom Messages
Simple custom data structuresCreate custom messages with structured JSON data for various use cases and interactive content.
Required Parameters
| Parameter | Type | Description |
|---|---|---|
subChannelId | String | Target subchannel identifier for the custom message |
data | Object/JSON | Free-form JSON object containing your custom data structure |
Optional Parameters
| Parameter | Type | Description |
|---|---|---|
tags | Array<String> | Message categorization and filtering tags |
parentId | String | Parent message ID for threaded conversations |
metadata | Object | Additional properties for extended functionality |
Code Examples
JSON Structure: Custom message data supports any valid JSON structure including nested objects, arrays, and primitive types. Design your data schema to match your UI requirements.
Custom Message Use Cases
Polls & Surveys
Polls & Surveys
Interactive voting and feedback collectionPoll Features
- Single/Multiple Choice: Support for both single selection and multiple selection polls
- Anonymous Voting: Optional anonymous voting for sensitive topics
- Time-Limited Polls: Set expiration dates for time-sensitive decisions
- Real-Time Results: Live vote counting and results display
- Multi-Question Surveys: Complex surveys with various question types
- Conditional Logic: Show/hide questions based on previous answers
- Progress Tracking: Visual progress indicators for long surveys
- Response Analytics: Detailed analytics on survey responses
- Rating Scales: 1-5 or 1-10 rating questions
- Open Text: Free-form text responses
- Multiple Choice: Single or multiple selection options
- Yes/No: Simple binary questions
Poll Data Structure
Location & Events
Location & Events
Location sharing and event managementLocation Sharing
- GPS Coordinates: Precise latitude/longitude coordinates
- Address Information: Human-readable addresses and venue details
- Interactive Maps: Embedded map views with directions
- Location Metadata: Additional context like floor, room, or landmarks
- Event Details: Date, time, duration, and timezone information
- Venue Information: Location details with capacity and amenities
- Registration System: RSVP functionality with attendee limits
- Calendar Integration: Export to calendar applications
- Meeting Coordination: Share meeting locations and details
- Event Announcements: Company events and social gatherings
- Emergency Coordination: Share emergency meeting points
- Field Work: Location updates for remote teams
Location Data Structure
Rich Cards & Widgets
Rich Cards & Widgets
Structured content displays and interactive widgetsRich Card Features
- Visual Hierarchy: Title, subtitle, and body content organization
- Media Integration: Images, videos, and file attachments
- Action Buttons: Interactive buttons for user actions
- Custom Styling: Colors, layouts, and branding options
- Booking Widgets: Appointment and reservation systems
- Product Showcases: Product information with pricing
- Status Updates: Project status and progress indicators
- Announcement Cards: Important updates with rich formatting
- Buttons: Call-to-action buttons with custom actions
- Forms: Embedded forms for data collection
- Media Players: Audio and video playback controls
- External Links: Deep links to other applications
Rich Card Structure
Business Workflows
Business Workflows
Enterprise workflow integration and automationApproval Workflows
- Multi-Step Approvals: Complex approval chains with multiple approvers
- Conditional Logic: Different approval paths based on criteria
- Deadline Management: Time limits for approval decisions
- Audit Trail: Complete history of approval actions
- Task Assignment: Assign tasks with due dates and priorities
- Progress Tracking: Status updates and completion tracking
- Dependencies: Task dependencies and blocking relationships
- Resource Allocation: Resource and time estimates
- External Systems: Connect to HR, CRM, and project management tools
- API Webhooks: Trigger external actions based on message interactions
- Data Synchronization: Keep external systems in sync
- Reporting: Generate reports from workflow data
Approval Workflow Structure
Best Practices
Data Structure Design
Data Structure Design
Designing effective custom message schemasSchema Design Principles
- Consistent Structure: Use consistent field names and data types across similar message types
- Extensibility: Design schemas that can be extended without breaking existing implementations
- Validation: Include validation rules and constraints in your schema design
- Documentation: Maintain clear documentation of your custom message schemas
- Size Limits: Keep custom message data under reasonable size limits (recommended < 50KB)
- Nesting Depth: Avoid excessive nesting that can impact parsing performance
- Required vs Optional: Minimize required fields to reduce validation overhead
- Indexing: Design data structure to support efficient searching and filtering
- Schema Versioning: Include version information in your custom message schema
- Backward Compatibility: Ensure new versions are backward compatible when possible
- Migration Strategies: Plan for data migration when schema changes are required
- Deprecation: Properly deprecate old schema versions with clear timelines
Schema Design Example
User Experience
User Experience
Creating intuitive custom message interfacesUI Design Guidelines
- Visual Consistency: Maintain consistent visual design across all custom message types
- Loading States: Provide appropriate loading indicators for interactive elements
- Error Handling: Display clear error messages for failed interactions
- Accessibility: Ensure custom messages are accessible to all users
- Touch Targets: Ensure interactive elements have appropriate touch target sizes
- Feedback: Provide immediate feedback for user interactions
- Progressive Disclosure: Show complex information progressively to avoid overwhelming users
- Contextual Actions: Provide relevant actions based on user permissions and context
- Responsive Design: Ensure custom messages work well on all screen sizes
- Touch Gestures: Support appropriate touch gestures for mobile interactions
- Performance: Optimize rendering performance for complex custom messages
- Network Awareness: Handle poor network conditions gracefully
- Cross-Platform Testing: Test custom messages across all supported platforms
- User Testing: Conduct user testing to validate custom message designs
- Performance Testing: Test performance with large datasets and complex interactions
- Accessibility Testing: Verify accessibility compliance and usability
Related Features
Text Messages
Standard messaging
Basic text messaging capabilities
Message Management
Content control
Edit, delete, and moderate message content
Real-Time Updates
Live synchronization
Real-time message updates and interactions