Skip to main content

How to connect Infobip SMS to an AI Agent

Connect your Flametree AI agent to Infobip SMS to enable automated conversations through SMS messaging. This integration allows your agent to send and receive SMS messages, making it accessible to users via their mobile phones worldwide.

Prerequisites

  • An active Infobip account with SMS capabilities
  • Infobip API credentials (API Key, Base URL, Sender ID)
  • A Flametree account with agent creation permissions
  • Admin access to the Flametree integration settings

Setting Up Infobip SMS Integration

Step 1: Obtain Infobip Credentials

  1. Log into Infobip Portal

  2. Get API Key

    • Go to AccountAPI Keys
    • Create a new API key or copy an existing one
    • Keep this secure - you'll need it for Flametree integration
  3. Note Your Base URL

    • Find your base URL in the Infobip portal
    • Format: xxxxx.api.infobip.com (without https://)
  4. Configure Sender ID

    • Set up your sender ID in Infobip portal
    • This will appear as the sender name/number for SMS messages

⚠️ Warning: Store your API credentials safely. Anyone with these credentials can send SMS messages using your account.

Step 2: Configure Integration in Flametree

  1. Navigate to Integrations

    • Go to Integrations section in Flametree
    • Find Infobip card and click Add +
  2. Fill Configuration

FieldDescriptionRequiredExample
NameCustom name for this integration✅ Yes"SMS Support Channel"
DescriptionOptional description for internal reference✅ Yes"Customer support via SMS"
API KeyInfobip API key from your account✅ YesApp 1234567890abcdef...
Base URLYour Infobip base URL✅ Yesxxxxx.api.infobip.com
Sender IDThe sender identifier for outgoing SMS✅ YesYourBrand or +1234567890
  1. Save Integration
    • Click Save to create the integration

Step 3: Connect to AI Agent

  1. Open Agent Configuration

    • Navigate to your target AI agent's settings
    • Go to Communication channels section
  2. Assign Channel

    • Select your Infobip SMS integration from the list
    • Save the agent configuration
  3. Restart Agent

    • Restart the agent for changes to take effect
    • This step is mandatory for the integration to work

❗️ Important: Always restart both the agent and channel after making changes.

Features

Supported Message Types

FeatureSupportNotes
Text MessagesFullUp to 1600 characters (concatenated SMS)
Delivery ReportsFullReal-time delivery status tracking
MMS/ImagesNot supportedText-only communication
Rich MediaNot supportedPlain text messages only

Message Handling

  • Character Limit: Messages over 1600 characters are automatically truncated with "..." appended
  • Phone Number Formatting: Automatically adds "+" prefix if missing
  • Delivery Tracking: Monitors message delivery status and logs results
  • Error Handling: Comprehensive error logging and recovery

Testing Your Integration

Quick Test Steps

  1. Send Test SMS

    • Have the agent send a message to your phone number
    • Verify you receive the SMS correctly
  2. Reply via SMS

    • Reply to the received SMS
    • Check if the AI agent processes and responds to your message
  3. Check Delivery Status

    • Monitor the logs for delivery reports
    • Verify messages are being delivered successfully

Test Message Format

When testing, ensure phone numbers are in international format:

  • ✅ Correct: +1234567890
  • ✅ Correct: 1234567890 (+ will be added automatically)
  • ❌ Incorrect: 123-456-7890
  • ❌ Incorrect: (123) 456-7890

Common Issues & Solutions

SMS messages not being sent

Possible causes:

  • Invalid API credentials
  • Insufficient Infobip account balance
  • Incorrect phone number format
  • Sender ID not configured properly

Solutions:

  1. Verify credentials: Check API key, base URL, and sender ID
  2. Check balance: Ensure sufficient credits in Infobip account
  3. Format validation: Use international phone number format
  4. Review logs: Check integration logs for specific error messages
  5. Test with Infobip: Send a test message directly through Infobip portal
Not receiving incoming SMS messages

Possible causes:

  • Webhook not properly configured
  • Firewall blocking incoming requests
  • Incorrect webhook URL in Infobip settings

Solutions:

  1. Verify webhook: Ensure webhook endpoints are accessible
  2. Check Infobip settings: Verify incoming message webhook configuration
  3. Test webhook: Use the GET /webhook endpoint for verification
  4. Review firewall: Ensure Infobip IPs can reach your webhook URLs
Messages being truncated

Possible causes:

  • Messages exceeding SMS character limits
  • Concatenated SMS not supported by carrier

Solutions:

  1. Adjust content: Keep messages under 160 characters for single SMS
  2. Review templates: Modify agent responses to be more concise
Delivery reports not working

Possible causes:

  • Webhook URL not configured in Infobip
  • Delivery reports not enabled in Infobip account
  • Network connectivity issues

Solutions:

  1. Configure webhook: Set delivery report webhook in Infobip portal
  2. Enable reports: Check Infobip account settings for delivery reports
  3. Test connectivity: Verify webhook endpoint is reachable

FAQ

What countries are supported for SMS?

Infobip supports SMS delivery to over 190 countries worldwide. Coverage depends on your Infobip account configuration and local regulations. Check the Infobip portal for specific country coverage and pricing.

How much do SMS messages cost?

SMS pricing varies by destination country and is charged through your Infobip account. Refer to Infobip's pricing documentation or contact their sales team for detailed pricing information.

Can I customize the sender ID?

Yes, you can set a custom sender ID through the INFOBIP_SENDER_ID environment variable. The sender ID can be:

  • Alphanumeric: Up to 11 characters (e.g., "YourBrand")
  • Numeric: A phone number (e.g., "+1234567890")

Note that sender ID support varies by country and carrier.

How are long messages handled?

Messages longer than 160 characters are automatically sent as concatenated SMS messages. The system supports up to 1600 characters (approximately 10 SMS segments). Messages exceeding this limit are truncated with "..." appended.

Are delivery reports reliable?

Delivery reports provide the best available information about message delivery status. However, reliability depends on:

  • Carrier support for delivery reports
  • Network conditions
  • Recipient device status

Some carriers may not provide detailed delivery information.

Can I use shortcodes or long codes?

Yes, Infobip supports various number types including:

  • Shortcodes: 3-6 digit numbers for high-volume messaging
  • Long codes: Standard phone numbers
  • Alphanumeric senders: Text-based sender IDs

Configuration depends on your Infobip account setup and local regulations.

Security Considerations

API Security

  • Protect API Keys: Never expose API keys in client-side code or public repositories
  • Use HTTPS: All communications use HTTPS encryption
  • Rotate Credentials: Regularly rotate API keys for enhanced security
  • Monitor Usage: Track API usage for unusual patterns

Privacy Compliance

  • Data Protection: Ensure SMS content complies with local privacy regulations (GDPR, CCPA, etc.)
  • Opt-out Mechanism: Implement clear opt-out procedures for recipients
  • Message Retention: Configure appropriate message retention policies
  • Consent Management: Obtain proper consent before sending marketing messages

Webhook Security

  • IP Whitelisting: Restrict webhook access to Infobip IP ranges
  • Request Validation: Validate incoming webhook requests
  • Rate Limiting: Implement rate limiting on webhook endpoints
  • Error Handling: Secure error responses to prevent information disclosure

Advanced Features

Message Templates

Create reusable message templates for common scenarios:

Welcome template: "Hello {name}! Welcome to {company}. How can we help you today?"
Support template: "Thank you for contacting {company} support. Your ticket #{ticket_id} has been created."

Delivery Status Tracking

Monitor message delivery with detailed status information:

  • PENDING: Message accepted by Infobip
  • DELIVERED: Successfully delivered to recipient
  • UNDELIVERED: Failed to deliver (invalid number, network issues)
  • EXPIRED: Message expired before delivery

Integration Monitoring

Track integration health and performance:

  • Message Volume: Monitor daily/monthly SMS volume
  • Delivery Rates: Track successful delivery percentages
  • Response Times: Monitor API response times
  • Error Rates: Track failed message attempts

Best Practices

Message Design

  1. Keep It Concise: SMS works best with brief, clear messages
  2. Include Context: Provide enough information for users to respond appropriately
  3. Clear Call-to-Action: Make it obvious what the user should do next
  4. Brand Consistency: Use consistent tone and terminology

User Experience

  1. Response Time: Aim for quick responses to maintain engagement
  2. Error Handling: Provide helpful error messages for invalid inputs
  3. Conversation Flow: Design logical conversation paths
  4. Fallback Options: Offer alternative contact methods if needed

Operational Excellence

  1. Monitor Costs: Track SMS usage to manage costs effectively
  2. Regular Testing: Test the integration regularly with various scenarios
  3. Log Analysis: Review logs for performance optimization opportunities
  4. Capacity Planning: Monitor usage patterns for scaling decisions