Twilio Integration
Telgea integrates with Twilio to provide SMS messaging capabilities for various user communications. This integration enables sending SMS messages for verification codes, notifications, and alerts to our users.Usage Scenarios
The Twilio integration is used for the following scenarios:-
Individual Number Porting
- Sending verification codes to users during the number porting process (Ensures secure verification of user identity)
-
Top-up Verification
- Sending verification codes for top-up transactions (Adds an extra layer of security for financial transactions)
-
Roaming Notifications
- Sending SMS alerts to users about roaming charges (Helps users stay informed about their usage and costs)
Sender ID Configuration
The integration supports two types of sender IDs:-
Alphanumeric Sender ID: Used in countries that support this feature
- Default sender ID: “Telgea”
- Provides a more professional and recognizable sender identity
- See the list of countries supporting alphanumeric sender IDs
-
Phone Number: Used as a fallback in countries that don’t support alphanumeric sender IDs
- Uses a dedicated Twilio phone number
Environment Configuration
The following environment variables are required for the Twilio integration:Callback Functionality
The integration includes a callback API endpoint that receives and logs SMS delivery status updates from Twilio. This helps in:- Tracking message delivery status
- Monitoring failed deliveries
- Debugging message delivery issues
/api/v0/integrations/twilio/sms_callback
Security Considerations
- The Twilio authentication token should be kept secure and never exposed in client-side code
- Environment variables should be properly configured in production environments
- Regular rotation of authentication credentials is recommended
- Monitor callback logs for any suspicious activity
Best Practices
-
Error Handling
- Implement proper error handling for failed SMS deliveries
- Monitor delivery status through callbacks
- Have fallback mechanisms for critical messages
-
Rate Limiting
- Be mindful of Twilio’s rate limits
- Implement appropriate queuing for bulk messages
-
Message Content
- Keep messages concise and clear
- Include necessary disclaimers where required
- Follow local regulations regarding SMS content
-
Testing
- Test SMS delivery in all supported countries
- Verify both alphanumeric and phone number sender IDs
- Test callback functionality regularly
Useful Links
Console Access
- SMS Logs - Monitor and debug SMS delivery status
- Geo Permissions - View and manage countries enabled for SMS reception
- Messaging Services - Configure messaging services for alphanumeric sender ID
Documentation
- International Support for Alphanumeric Sender ID - Comprehensive list of countries supporting alphanumeric sender IDs