Add comprehensive Content API examples with JSON payload demonstrations #758
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Content API was missing usage examples for creating message templates with JSON payloads. This was particularly challenging for developers because the API supports 13 different content types, each requiring specific JSON payload structures and different handling approaches.
This PR adds comprehensive examples demonstrating all Content API functionality:
New Files Added
examples/content_api_basic.rb
Basic content types for common messaging scenarios:
examples/content_api_advanced.rb
Advanced interactive content types:
examples/content_api_whatsapp.rb
WhatsApp-specific content types and multi-language support:
examples/CONTENT_API.md
Comprehensive documentation covering:
Content Types Demonstrated
Twilio Content Types:
twilio/text
- Simple text messagestwilio/media
- Text with media attachmentstwilio/location
- Location sharing with coordinatestwilio/list-picker
- Interactive selection menustwilio/call-to-action
- Action buttons (URL, phone)twilio/quick-reply
- Quick response buttonstwilio/card
- Rich card layoutstwilio/catalog
- Product catalogs with pricingtwilio/carousel
- Horizontal scrolling cardstwilio/flows
- Interactive conversation flowstwilio/schedule
- Appointment schedulingWhatsApp Content Types:
whatsapp/card
- WhatsApp Business cardswhatsapp/authentication
- OTP and authentication templatesKey Features
{{1}}
,{{2}}
placeholder demonstrationThese examples directly address the challenge mentioned in the issue where developers needed guidance on handling different content types with their specific JSON payload requirements.
Fixes #757.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.