Get access to your trial account
Please enter valid Full Name
Please enter valid Company Email
tick greenred cross
Please enter valid Phone Number
Please choose valid Usecase
Please enter valid Detailed Requirement
By Creating an Account with Plivo, you agree to the Plivo’s Terms of Service and Privacy Policy
Thank you icon
Thank you for your submission.

Volume pricing starts at 200,000 units/ month. For lower volumes, check our standard pricing

Thank you for your interest in Plivo.
Unfortunately, based on the information you provided, we are unable to provide service at this time.
We apologize for any inconvenience this may cause and appreciate your understanding.

Thanks for your interest in Plivo. We have two account options available to meet customers’ varying needs:

  • Self-service: no commitment, standard pricing, free basic support.
  • Committed spend agreement: guided implementation, premium support options, and discounted rates. These packages involve an annual contract starting at $750 a month.
Based on the information that you provided, a self-service account seems like the right fit for your business. Use the links below to get started:
If you’d like to discuss a committed spend agreement, please provide us a bit more information by filling out this form.
Oops! Something went wrong while submitting the form.
Fill out Calender form
You’re all set!
Thank you. We've received your request.
Our team will contact you shortly to get you started.
Featured

What is SMS Pumping: Plivo’s Quick Guide

Jan 8, 2024
7 mins

Learn about SMS pumping, the risks it poses to businesses, how fraudsters generate fake traffic to exploit them, and how to prevent it.

In the digital age, SMS remains a cornerstone for user authentication, particularly through One-Time Passwords (OTPs). However, this reliance has made businesses vulnerable to a growing threat: SMS pumping fraud.

What is SMS pumping?

SMS pumping, also known as Artificially Inflated Traffic (AIT) or SMS toll fraud, is a fraudulent scheme where attackers exploit SMS-based services to generate large volumes of fake traffic. This is typically achieved by:

  • Automated Bots: Using bots to flood online forms with fake OTP requests.
  • Premium Rate Numbers: Directing these requests to phone numbers that incur higher charges, often controlled by the fraudsters or complicit telecom operators.

The perpetrators profit by receiving a share of the revenue generated from these inflated SMS charges, leaving businesses to bear the financial burden.

Real-World Impact: The Twitter Case

A notable example of SMS pumping's financial impact is Twitter (now X). In 2023, Elon Musk revealed that the platform was losing approximately $60 million annually due to SMS pumping fraud. The scheme involved over 390 telecom operators worldwide, who were either complicit or negligent in allowing the abuse of SMS services.

How does SMS pumping work?

The process typically unfolds as follows:

  1. Targeting Vulnerable Endpoints: Attackers identify websites or applications that send OTPs via SMS.
  2. Flooding with Requests: Bots submit numerous fake requests, often using disposable or premium-rate phone numbers.
  3. Revenue Generation: Each SMS sent to these numbers incurs a cost, which is shared with the fraudsters.

This leads to significant financial losses for businesses, as they pay for messages that serve no legitimate purpose.

Signs Your Business Might Be a Target

Be vigilant if you notice:

  • Unusual Traffic Patterns: A sudden spike in OTP requests, especially from unfamiliar regions.
  • Sequential Number Requests: Multiple OTP requests to consecutive phone numbers, indicating automated bot activity.
  • Low Conversion Rates: A high number of OTPs sent but a low rate of successful authentications.

Preventive Measures: Safeguarding Your Business

To protect against SMS pumping fraud, consider implementing the following strategies:

  • Rate Limiting: Restrict the number of OTP requests per user or IP address within a specified time frame.
  • Bot Detection: Use CAPTCHA or other bot detection mechanisms to prevent automated submissions.
  • Geo-Blocking: Limit OTP requests to regions where your user base is located.
  • Traffic Monitoring: Regularly analyze traffic patterns to identify and mitigate suspicious activities.

Plivo’s Solutions to SMS Pumping

Recognizing the growing threat of SMS pumping, Plivo is proud to offer two innovative tools, free of charge, designed to protect your business from fraudulent SMS traffic:

  1. SMS Pumping Protection for OTP Traffic: This solution is specifically built to safeguard your SMS API endpoints that handle OTP traffic. By detecting and preventing fraudulent OTP requests, it helps ensure your messaging services remain both secure and cost-effective. Read more about SMS Pumping Protection here.
  2. Fraud Shield for Verify Applications: Designed for applications leveraging Plivo’s Verify API, Fraud Shield delivers advanced fraud detection by analyzing traffic patterns, identifying anomalies, and blocking suspicious activities. This ensures your verification processes stay protected from abuse. Read more about Fraud Shield here.

Learn more about Plivo’s tools for combating SMS pumping by requesting a trial.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Jun 19, 2025
5 mins

RCS Marketing 101: Your Complete Guide

Discover how RCS marketing delivers rich, branded messages that drive engagement for your business.

SMS marketing works, but let’s be honest: it feels a bit outdated compared to modern apps.

But what if you could send rich, interactive messages with branded content, images, buttons, and carousels straight to your customers’ native messaging apps?

Rich communication services (RCS) makes that possible.

If you’re ready to explore how RCS marketing can transform your engagement strategy, this guide will walk you through everything you need to know. Let’s get started.

What is RCS marketing? 

RCS marketing uses rich communication services to send interactive, branded messages through a customer’s default messaging app. It’s a modern upgrade to SMS that lets businesses share images, buttons, carousels, and more — all without needing third-party apps.

A user on Reddit summed up this perfectly:

Screenshot of a Reddit comment explaining what RCS is
RCS explained by a Reddit user

RCS lets you send messages that are visually branded with logos and colors while remaining interactive. This turns static updates into an app-like experience inside a message.

This shift is part of a broader industry move, led by Google and backed by major mobile carriers, to upgrade messaging infrastructure and make RCS the default standard on Android devices.

As support continues to grow, businesses are adopting RCS as part of their customer engagement strategy. Platforms like Plivo make that adoption easier with a reliable, enterprise-grade gateway to deliver rich, reliable RCS campaigns at scale.

RCS vs. SMS marketing: A quick comparison

Marketers today are looking for ways to deliver more interactive and visual communication, and RCS is clearly leading the way.

While SMS still works well for simple alerts, it lacks the creativity and engagement that RCS marketing offers.

Let’s take a quick look at RCS vs. SMS marketing.

Key feature SMS marketing RCS marketing
Message length Limited to 160 characters; with longer messages split Up to 8,000 characters in a single message
Multimedia Supports only plain text and links; needs MMS for multimedia Natively supports high-resolution photos, videos, audio, and GIFs
Security and verification No built-in sender verification Includes verified sender profiles with business name, logo, and custom colors
Read receipts No standardized way to know if a message was delivered or read Provides delivery and read receipts for real-time engagement tracking
Typing indicators Doesn't show when the other party is typing Displays typing indicators, creating a more conversational feel
Interactive buttons Not supported; calls to action (CTAs) are limited to plain text links Allows interactive buttons with predefined replies and actions
User experience Static, text-heavy, and transactional Dynamic, visually rich, and conversational — feels more like a mobile app
Analytics and reporting Basic delivery tracking (if supported by carrier) Advanced analytics: opens, clicks, conversions, and user behavior tracking

4 key benefits of RCS marketing

RCS marketing makes messaging feel more natural for both you and your customers. And since you can see what’s working and what’s not, it’s easier to pivot your strategy and get better results.

Here are its four key benefits.

1. Improved user interaction

One of the biggest advantages of RCS marketing is how seamless it makes the experience for your customers. Instead of typing out replies or clicking a link to open a website, users can just tap a button right inside the message.

Want them to book a demo, check order status, or browse products? It’s all possible with just a tap.

Fewer steps mean less effort, and that leads to more people following through. In fact, individuals spend up to 37 seconds engaging with RCS messages, which is a lot longer than most other types of mobile messaging.

 Image showing the engagement results of RCS messaging
People engage more with RCS than any other platform

That extra time and interaction can make all the difference when you’re trying to convert interest into action.

2. Consistent brand experience

RCS marketing doesn’t just tell people who you are — it shows them.

Verified business profiles help people know they’re getting messages from the real brand. Every message shows your brand’s logo, name, colors, and a checkmark. These small details make it clear that the message is coming from a genuine source.

Image showing that MAYI - HOMES sends a verified RCS message with branding
Verified RCS message from MAYI - HOMES

This consistency matters because 88% of people are more likely to buy from a brand they trust.

3. In-depth analytics

With RCS marketing, you can track open rates, button clicks, and how people interact with each part of your message.

You get clear visibility into what’s working and where users are dropping off. 

This makes it much easier to measure the return on investment (ROI) and fine-tune your campaigns. The more you understand how people engage, the better you can shape your messaging for results.

4. Higher conversion potential

RCS marketing makes it easier for customers to take action — whether that’s browsing products, booking a service, or making a purchase — all within the message itself.

With fewer clicks and no need to switch apps, the path to conversion feels effortless. And when it’s that easy, more people follow through.

For example, EaseMyTrip used RCS to run a post-COVID travel survey. They added quick-tap answer options and followed up with a thank-you coupon. The campaign saw a 4x higher click-through rate than email, 10x more survey completions, and a 2.7% increase in conversion rate.

5 major use cases of RCS marketing

Here are five major use cases showing how brands are using RCS marketing effectively.

1. Product promotions

RCS makes product promotions feel more like browsing a store than reading a message. Brands can send image carousels that customers can swipe through to explore new arrivals, check product details, and see what’s available without leaving their messaging app.

Verified RCS message highlights a 25% off promotion on all items
Verified RCS message from Daily-donuts

Example: A fashion retailer promoting its spring collection could send an RCS message featuring a carousel of outfits with styled images, prices, and buttons like “View Lookbook” or “Shop Now.”

Tapping a button could open a mini product page inside the chat, letting customers browse and buy without switching apps.

2. Abandoned cart reminders

The average cart abandonment rate is over 70%, which means most shoppers never make it to the finish line. RCS marketing can help bring them back by making the reminder more engaging and easier to act on.

You can send a message that shows exactly what they left behind, along with a clear button to complete the purchase. It’s visual, straightforward, and the entire experience stays within their messaging app.

Example: A home electronics store could follow up with customers who left a pair of wireless earbuds in their cart. The RCS message might include a product photo, the price, and a “Buy Now” button that takes them straight to checkout.

3. Appointment confirmations and reminders

A PhD thesis from Manchester Metropolitan University found that forgetfulness is the most common reason people skip their appointments.

RCS makes it easier for both businesses and customers to stay on the same page. You can send a message that shows the appointment details along with a simple calendar view. Add buttons to confirm, reschedule, or cancel — all within the chat.

Image depicting an interactive RCS booking confirmation message
Booking confirmation via RCS with quick action buttons

Example: A dental clinic could use RCS to remind patients of upcoming cleanings. The message might show the date, time, and location of the appointment, plus a “Confirm” button and options to “Reschedule” or “Cancel.”

Patients can respond instantly, helping the clinic manage its schedule more efficiently.

4. Customer surveys and feedback

Getting feedback is important, but most customers lack the time or patience to complete lengthy forms. RCS marketing makes it easier by allowing brands to ask short, targeted questions and receive quick responses.

Plus, the rich features of RCS let you include images, ratings, or multiple-choice options, making feedback feel more like a conversation.

Example: A restaurant could send an RCS message after a meal asking customers to rate their experience with simple buttons like “Excellent,” “Good,” or “Needs Improvement.”

The message might also include a photo of the dish they ordered and a quick question like, “What did you like most?” This quick interaction makes it easy for customers to respond and gives the restaurant valuable insights.

5. Customer support follow-ups

After a support request is resolved, following up shows customers you care and helps close the loop on their experience. But if the follow-up message gets buried in an email inbox or goes unnoticed, that opportunity to connect is lost.

With RCS marketing, you can send a quick message to check if everything’s working fine. You can include helpful buttons like “Change Password,” “Manage Account,” or “Talk to Support.”

Support bot provides instant replies and follow-ups for customer queries
AI-powered support for account management

RCS marketing myths and realities

Despite RCS marketing’s growing adoption and proven results, some common misconceptions still hold businesses back from trying it. Let’s look at a few of the biggest myths and what’s actually true.

Myth 1: RCS marketing is too expensive

At first glance, RCS business messaging can seem like a pricey upgrade. Rich visuals, tap-to-action buttons, and branded layouts look premium, so it’s easy to assume they come with a hefty cost.

But cost alone doesn’t tell the full story.

What you get in return matters more. RCS drives significantly stronger engagement with higher click-through rates, increased interactions, and better overall outcomes.

Take Club Comex, the loyalty program of North American paint brand Comex. They sent two rich and interactive RCS campaigns to their members and saw a 10x higher click-through rate, which helped increase revenue by 115%.

That’s the value side of the equation. Better targeting and richer content mean more people click, engage, and convert.

Myth 2: RCS marketing doesn’t reach enough users to be worth it

This concern made sense in the early days of RCS, when adoption was still catching up. But the landscape looks very different now.

In June 2024, the 12-month growth of RCS users reached 36.3%, showing faster uptake than other messaging channels. More Android devices support RCS by default, and it’s being rolled out across more networks globally. Even Apple has announced support, which means RCS is on track to reach a massive number of smartphone users worldwide.

With that kind of growth and widespread support, the hesitation around RCS is starting to fade. Brands can confidently invest in RCS marketing knowing it will connect with more customers than ever before.

Myth 3: RCS gets treated like spam and ends up ignored just like emails

Unlike email, RCS messages appear directly in the user’s primary messaging app alongside personal conversations. They include rich media and interactive elements, making them more engaging and less likely to be ignored.

This creates a more natural, conversational experience that drives higher open and response rates than traditional marketing channels.

Why choose Plivo for your RCS marketing needs

With RCS, you can turn simple messages into rich, branded conversations that feel more like chatting than broadcasting.

Plivo gives you the tools to make that shift without the hassle. From verified messaging to smart automation, everything works together to help you connect better and respond faster.

When combined with AI Agents and a unified customer data platform, RCS becomes more than just messaging. You can deliver personalized experiences at scale, automate everyday interactions, and keep conversations flowing without lifting a finger.

Here’s what you get with Plivo’s RCS API:

  • Real-time personalization: AI Agents tailor conversations using customer profiles and behavior triggers to improve engagement and conversions.
  • Multi-channel fallback: If RCS isn’t supported, messages automatically switch to SMS to ensure delivery and maintain consistent communication.
  • Conversational automation: AI Agents handle FAQs, process orders, schedule deliveries, and route complex queries within RCS.
  • All-in-one messaging platform: Manage RCS, SMS, WhatsApp, Voice, and more from a single dashboard.
  • Reliable performance: 99.99% uptime and global infrastructure keep your campaigns running smoothly.

With Plivo’s no-code tools, you can quickly launch AI-powered RCS messaging across channels and deliver a consistent customer experience from day one.

See how you can launch your first RCS marketing campaign with Plivo by requesting a demo today!

Jun 19, 2025
5 mins

WhatsApp Agent Setup: How to Launch AI-Powered Conversations at Scale

Learn how WhatsApp agent setup works using Plivo to launch AI-powered, no-code agents that handle support, sales, and engagement at scale.

Your customers are on WhatsApp but are your agents?

If you’re still relying on manual replies, scripted chatbots, or email follow-ups, you’re leaving response time and revenue on the table.

The smarter path? AI-powered WhatsApp agents. They’re full-service, no-code agents that can resolve issues, qualify leads, and send personalized offers 24/7.

In this guide, we’ll walk you through WhatsApp agent setup using Plivo and understand how these agents help you automate conversations that convert.

What is a WhatsApp AI agent?

A WhatsApp AI agent is an automation designed to operate over the WhatsApp Business API. Unlike scripted bots, agents are built to understand intent, pull in context from your internal systems, and complete business tasks like answering account-specific questions or initiating transactions.

Plivo’s WhatsApp AI agents can be trained to use your brand voice, integrated with your CRM or helpdesk, and customized to handle specific use cases, such as subscription renewals, cart recovery, refund processing, or customer onboarding.

They are accessible through a no-code interface and support a multilingual, omnichannel customer experience across WhatsApp, SMS, RCS, and voice.

What you need before setting up your agent

To go live with a WhatsApp agent, you need:

  • A verified Meta Business Account
  • An active WhatsApp Business Account (WABA) tied to a phone number
  • Pre-approved message templates for outbound communication
  • WhatsApp Business API access through a business solution provider (BSP) (Plivo offers this natively)
  • A platform to design, train, and manage agents (Plivo Agent Studio)

Also read: How to Create WhatsApp Message Templates: A Complete Guide

Optional but recommended integrations:

  • CRM (like Salesforce, HubSpot, or Zoho)
  • Helpdesk (like Zendesk or Freshdesk)
  • E-commerce or billing tools (Shopify, Stripe, etc.)

Pro tip: If you want to fast-track API access and template approval, using a BSP like Plivo saves weeks of back and forth with Meta.

Step-by-step: How to set up a WhatsApp agent with Plivo

Follow this step-by-step guide for a smooth WhatsApp agent setup with Plivo.

Step #1: Choose your primary use case and define agent scope

Don’t build a generic bot. Start with why you’re automating. This could be handling support queries, sending order updates, re-engaging inactive customers, or managing subscription renewals.

Image showing users how to build their own lead qualification agent in Plivo
Build a WhatsApp AI agent in Plivo

Plivo provides a library of prebuilt AI agents for common use cases like cart recovery, lead qualification, appointment reminders, and product recommendations. You can choose to use one as-is or customize it to fit your business process. Each agent is compatible with WhatsApp and designed to operate across channels as needed.

Your online pet supply business sells dog food with a typical reorder cycle of 30 days. You want to automate reminders for repeat customers, so they never run out.

The goal is to build a WhatsApp AI agent that:

  • Identifies past purchase dates
  • Sends a timely reminder before the next reorder window
  • Offers a one-click reorder option with a discount
  • Escalates to a live agent if the customer has special dietary questions

Pro tip: If you're unsure where to begin, look at existing interactions on WhatsApp that are repetitive, time-sensitive, or frequently escalated — these are ideal starting points for automation.

Step #2: Build the agent using Plivo’s no-code platform

Since your API access is already set up, you can begin building your agent in Plivo’s Agent Studio. This is a visual, drag-and-drop builder where you create conversation flows using blocks that represent actions, responses, conditions, and triggers.

Image showing WhatsApp AI agent setup in Plivo without code
No-code campaign automation in Plivo’s AI Studio

You can structure your flow to respond to specific keywords, match customer intent, route inquiries to different departments, or escalate to a live agent when needed. Each step in the journey can include media-rich responses like buttons, product carousels, quick replies, and file attachments.

Beyond logic design, you can also configure fallback rules for when the agent is unsure, and add human handoff conditions to ensure escalations happen smoothly with full context transferred to the live agent.

Image demonstrating smart handoff from AI agents to human agents in Plivo
Human handoff conditions in Plivo

Example: In Agent Studio, you set up a trigger to activate the agent 25 days after a customer’s last dog food purchase.

The agent starts with: “Hi Alex! It’s almost time to restock Luna’s Chicken & Brown Rice dog food. Want us to ship it today with 10% off?”

Depending on the customer’s reply:

  • “Yes” triggers a checkout link
  • “No” prompts a snooze option or opt-out
  • “I have a question” escalates to a human agent with the full order history

This step allows you to fully customize the agent’s tone, workflow, and logic to reflect how your brand communicates.4

Example: In Agent Studio, you set up a trigger to activate the agent 25 days after a customer’s last dog food purchase.

The agent starts with:
“Hi Alex! It’s almost time to restock Luna’s Chicken & Brown Rice dog food. Want us to ship it today with 10% off?”

Depending on the customer’s reply:

  • “Yes” triggers a checkout link
  • “No” prompts a snooze option or opt-out
  • “I have a question” escalates to a human agent with the full order history

Step #3: Train your agent with AI

Plivo supports integration with internal systems like your CRM, order management platform, inventory tools, or helpdesk. This means your agent can access real-time customer data, past orders, preferences, and policies to deliver personalized responses.

You can also connect your knowledge base, including FAQs, SOPs, product documentation, or policy articles. These resources train the agent to respond accurately and contextually, without needing scripted answers.

Dashboard image of Plivo’s AI Studio prompting users to import from a file or sync from a website
Import external knowledge from various sources into Plivo

For natural language understanding, Plivo gives you the flexibility to choose the AI model that powers your agent.

Image depicting LLM options for your WhatsApp AI agent in Plivo
Select the LLM that fits your business best

You integrate your Shopify store to pull order dates and product SKUs. You also sync your product FAQ sheet so the agent can answer:

  • “Is this food grain-free?”
  • “What’s the shelf life?”
  • “Can I switch to lamb instead of chicken?”

You power the agent using OpenAI to ensure a natural, friendly tone and multilingual support for your Spanish-speaking customers.

Step #4: Test, launch, and monitor your agent

Once your flow is built and trained, run controlled tests:

  • Check for flow accuracy and intent matching
  • Review how it handles incomplete or unclear inputs
  • Test human handoff and see if the agent transfers the full context
Image showcasing WhatsApp AI agent engagement analytics in Plivo
Monitor agent performance and engagement with Plivo

Plivo’s real-time dashboard lets you:

  • Monitor delivery, engagement, and satisfaction metrics
  • Track where users drop off in conversations
  • Identify areas to improve agent logic or content
  • Compare campaign and agent performance across channels

After launch, your agent keeps learning. As more customers interact, you’ll gather insight to improve how it responds or what paths it offers.

You run a test with 50 loyal customers. The data shows that:

  • 72% clicked the reorder button within three hours
  • 18% asked about switching flavors
  • 10% requested a pause or cancel

You adjust the flow by adding a flavor selection block and a “remind me next week” option. The analytics also show high engagement around 8 p.m., so you shift reminder timings accordingly.

Plivo is purpose-built for WhatsApp AI agent deployment

Plivo’s platform is designed to help you move from idea to live AI-powered engagement without requiring engineering support or external consultants. When you use Plivo for WhatsApp agent setup, you get:

  • Access to prebuilt agents for sales, support, and engagement
  • Intuitive no-code builder (Agent Studio) that puts you in control
  • Deep integration with your business systems for real-time, contextual replies
  • Support for the best LLMs on the market, so your agent is trained with intelligence
  • Built-in compliance with WhatsApp’s policies and global data laws
  • Unified interface to manage messaging across WhatsApp, SMS, RCS, and Voice
  • Enterprise-grade infrastructure with 99.99% uptime and expert onboarding support

Automate outcomes with WhatsApp agent setup in Plivo

Smart WhatsApp automation starts with smart setup. With Plivo's no-code platform, you can automate customer conversations, boost sales, and scale support — all without a development team.

Plivo offers the tools to build agents that reflect your brand, the infrastructure to scale securely, and the intelligence to adapt with your customer needs.

Whether you're trying to cut support wait times, recover abandoned carts, or drive upsells through personalized outreach, a well-built WhatsApp agent can make it happen, and Plivo makes it achievable.

Ready to get started? Request a free trial today!

Jun 19, 2025
5 mins

The Definitive Guide to Automating WhatsApp for Business

Learn how WhatsApp automation can simplify customer communication and scale operations. Know about its key benefits and use cases. Get started today.

Remember when WhatsApp was just a simple messaging app? Launched in 2009, it was a tool for friends and family to stay in touch. 

Fast-forward to today, and WhatsApp has become a global powerhouse with over 3 billion monthly active users. Businesses worldwide leverage WhatsApp to connect with customers, share updates, and provide support.

Many businesses struggle to keep up with the growing volume of customer messages on WhatsApp. Manually handling inquiries, sending updates, or following up on leads can quickly become overwhelming and inefficient. 

This is where WhatsApp automation steps in.

By automating repetitive messaging tasks, businesses can reduce manual workload, respond faster, and deliver more personalized, timely communication. 

In this article, we'll explore what WhatsApp automation is, why it's essential for modern businesses, and how you can implement it to improve customer engagement and operational workflows.

What is WhatsApp automation?

WhatsApp automation is the use of technology to automatically send and manage messages on the platform, especially for business and customer engagement purposes.

It doesn’t require human intervention for every interaction. As a result, businesses can handle customer inquiries, deliver updates, and engage with prospects efficiently.

Image showing WhatsApp with a conversation, highlighting conversational commerce.
A customer engaging with a brand through WhatsApp for shopping -Source

With WhatsApp business automation, you can:

  • Auto-respond to FAQs and reduce ticket volume.
  • Reduce customer support load with proactive messaging.
  • Route complex support queries to live agents only when needed.
  • Send order confirmations and delivery updates automatically.
  • Share return instructions based on customer actions.
  • Run re-engagement campaigns with smart timing.
  • Integrate with Shopify, Magento, and more for real-time updates.
  • Trigger workflows from CRMs or e-commerce platforms.
  • Keep messaging compliant with auto opt-outs and logs.

Here’s a breakdown of the three main types of automated messaging on WhatsApp:

Message Type Description Example
Transactional Messages are triggered by specific customer actions or events. "Your order has been shipped!"
Promotional Messages that promote products, services, or special offers. "Get 20% off your next purchase – limited time only!"
Conversational Automated responses that simulate a two-way conversation. "How can I assist you today?"

Key benefits of WhatsApp automation

By automating routine tasks, WhatsApp can help your business stay responsive and consistent across customer touchpoints. Here’s how it can benefit your business:

Reduce manual workloads and response times

When you automate WhatsApp interactions, every department, from marketing to customer service, runs more smoothly.

By automating routine tasks like order updates, FAQs, and customer inquiries, businesses can significantly reduce the manual effort required.

This means your team spends less time on repetitive tasks and more time focusing on high-priority interactions.

Result: Faster response times and more efficient workflows.

Increases the scalability of customer interactions

As your business grows, the number of customer interactions increases. Automation allows you to scale communication efforts without hiring additional staff or losing the personal touch.

Whether you're dealing with 50 or 5,000 customers, automated responses ensure that each inquiry is handled swiftly and consistently.

Enhances customer experience through personalization

Automated WhatsApp messages can be personalized based on customer data, creating a more relevant and tailored experience.

From addressing customers by name to offering product recommendations based on past purchases, personalization makes customers feel valued. This leads to higher engagement rates and improved loyalty.

End result: Higher customer satisfaction and increased loyalty.

Cost-effectiveness compared to manual processes

WhatsApp automation eliminates the need for large customer support teams and reduces the time spent on repetitive tasks.

This saves on operational costs and also leads to a more efficient allocation of resources.

Pro tip: Monitor your automation metrics regularly to find areas where you can cut costs further without affecting quality.

5  popular use cases of WhatsApp automation across industries

Businesses everywhere are finding new ways to use WhatsApp automation. Here are five popular examples:

1. Customer support

Automating common FAQs and routine inquiries on WhatsApp helps customers get instant answers anytime. This reduces the number of tickets support teams have to handle, letting them focus on more complex problems.

Example messages:

“Hi! How can I help you today? Here are some quick answers: For billing info, reply 1; For plan details, reply 2.”

“We’ve received your request and will get back to you within 24 hours.”

2. E-commerce operations

Order confirmations, shipping updates, and delivery notifications keep customers informed every step of the way. Automating returns and collecting feedback via WhatsApp speeds up these processes and improves customer satisfaction.

Example messages:

“Thank you for your order #12345! It is being processed and will ship soon.”

“Good news! Your package is out for delivery and should arrive by 5 PM today.”

“Need to return an item? Reply ‘Return’ and we’ll guide you through the process.”

3.Marketing and lead nurturing

Automated lead follow-ups ensure timely, consistent engagement with prospects, boosting conversion chances. Also, you can use personalized re-engagement campaigns to help bring back inactive customers with offers or updates tailored to their interests.

Example messages:

“Hi [Name], thanks for your interest! Ready to take the next step? Book a free demo here: [link]”

“We miss you! Enjoy 15% off your next purchase with code WELCOME15.”

“Exclusive offer just for you, [Name]! Check out our new arrivals: [link]”

4.Event management and invitations

Automated WhatsApp invites, updates, and follow-ups keep your audience informed and engaged, boosting the attendance rate. This helps you stay connected and make every event a success.

5.Appointment scheduling and reminders

Timely reminders help customers remember appointments, reducing cancellations and improving the overall experience. Automation makes scheduling easier and more efficient for both businesses and customers.

Example messages:

“Your appointment with Dr. Smith is confirmed for June 20 at 2 PM. Reply ‘Cancel’ to reschedule.”

“Hi! Just a friendly reminder about your hair salon appointment tomorrow at 11 AM.”

“Need to book an appointment? Reply ‘Book’ and we’ll help you find the perfect time.”

Step-by-step guide to implement WhatsApp automation for your business

To successfully implement WhatsApp automation, follow these key steps that cover planning, setup, and optimization. 

Step 1: Define your use cases and goals

Start by identifying which business functions, such as order updates, customer support, or lead follow-ups, will benefit most from automation.

Set clear, measurable goals like: 

  • Reducing response times 
  • Lowering manual workload 
  • Boosting customer engagement 

This will guide your automation strategy and help you track success.

Also, ensure compliance from the start. WhatsApp requires businesses to obtain explicit customer opt-in before sending messages. To stay compliant:

  • Use clear, transparent language when requesting consent.
  • Collect opt-ins through channels like website forms, checkout flows, or click-to-chat ads.
  • Log and manage consent within your systems for audit readiness.

Data privacy and compliance are essential for building trust and maintaining long-term customer relationships.

Step 2: Choose the right WhatsApp business API provider

Select a platform that fits your specific needs. Look for features like:

  • Robust CRM integrations
  • Audience segmentation
  • Flexible automation workflows

These capabilities simplify your communication and scale your efforts efficiently.

Make segmentation a priority, use tagging and grouping strategies to target the right customers with the right messages. 

With smart tagging and grouping, you can:

  • Deliver personalized messages
  • Engage the right people at the right time
  • Improve conversion and retention

Example: Send exclusive offers to loyal buyers and welcome discounts to new customers. Good segmentation enhances your automation and drives better outcomes.

Step 3: Set up your WhatsApp business account

You must set up a verified WhatsApp Business account to use WhatsApp for automated messaging. This includes:

  • Registering your business name and details.
  • Verifying a dedicated phone number.
  • Getting approval from Meta to use the WhatsApp Business API.

This ensures that your business is recognized as a legitimate sender.

Your WhatsApp API provider will typically assist with onboarding, including submitting documentation and setting up the technical aspects. 

Some platforms also offer pre-built tools to help you manage mobile number registration, display name approval, and message template submissions.

Pro tip: To avoid disruptions, choose a phone number that’s not already tied to a personal WhatsApp account.

Step 4: Create and submit message templates

Start by designing message templates for everyday customer interactions, such as:

  • Promotional messages (e.g., limited-time offers)
  • Transactional updates (e.g., order confirmations, delivery alerts)
  • Support messages (e.g., ticket updates or issue resolution)

Each template must follow WhatsApp’s formatting and content policies.

Once your templates are ready, submit them through your WhatsApp API provider for Meta’s approval. Only approved templates can be used for proactive messaging.

Step 5: Build automation workflows

Now that your account and templates are ready, it’s time to connect WhatsApp with the rest of your tech stack. Integrate with:

  • CRM systems (to access customer data)
  • Support tools (for query management)
  • E-commerce platforms (to track orders and actions)

Use event-based triggers, like a new order, a cart abandonment, or a support ticket, to automatically send relevant messages.

Additionally, plan for human fallback. Automation can’t handle everything. Build intelligent workflows that escalate to a human agent when:

  • A customer requests help
  • The query is too complex
  • Sentiment detection flags a negative experience

This keeps your support experience smooth, responsive, and frustration-free.

Step 6: Test, launch, and optimize

Start with a pilot campaign to ensure everything runs smoothly.

Track key metrics:

  • Response time
  • Open rate
  • Conversion rate

Use these insights to refine your workflows, improve message content, and adjust targeting.

Best practices for WhatsApp automation 

Following some proven best practices is essential to get the most out of WhatsApp automation. Here’s what you need to know:

Tips for optimizing messaging frequency and timing

To keep your audience interested, it's vital to message thoughtfully and strategically. Here are some quick tips:

  • Avoid over-messaging to prevent unsubscribes.
  • Use analytics to identify when your audience is most active and receptive.
  • Space out messages to keep it natural.
  • Monitor response rates and adjust based on customer behavior and feedback.

Leverage data analytics for campaign performance 

By tracking metrics such as open rates, click-through rates, and response times, you gain valuable insights into what works and what doesn’t. Use this data to refine your messaging, target relevant audience segments, and optimize timing. 

Regularly reviewing analytics helps you make informed decisions that boost engagement and drive better results over time.

Compliance and customer privacy protection

To protect your customers and stay compliant, focus on these key areas:

Compliance What it means Best practise
GDPR Protects the personal data of EU customers Obtain consent, allow easy opt-out, and secure data
SOC 2 Ensures security and confidentiality standards Implement strong data controls and audits
Customer privacy Respect and protect user information Be transparent, limit data use, and maintain trust

Enhance customer communication with Plivo’s AI WhatsApp automation

The growing demand for instant, tailored communication on WhatsApp puts pressure on businesses to respond quickly. Customers expect fast, personalized replies around the clock, and doing this manually often leads to delays, inconsistent service, and missed opportunities. 

Finding a way to scale these conversations efficiently is critical for businesses looking to stay competitive.

That’s where Plivo comes in, an industry-leading omnichannel platform that automates and personalizes WhatsApp conversations, delivering timely responses at scale.

By leveraging Plivo’s WhatsApp AI agents, businesses can manage a wide range of customer communication tasks, from pre-sales inquiries to post-purchase support, without increasing their team size.

Here’s how Plivo can enhance your customer communication:

  • Brand-aligned AI agents: You can customize the AI agents to reflect your brand’s voice, tone, and style. This makes all customer interactions align with your brand’s identity and deliver a personalized experience.
  • AI customer service agent: Plivo’s AI agents work around the clock, ensuring your customers receive timely responses, regardless of the time zone. These agents process orders, resolve support issues, and answer questions.
AI customer service agent managing chats and orders.
Plivo’s AI agents provide 24/7 support, processing orders and answering customer questions promptly.
  • Natural, human-like conversations: With AI agents, you can engage in context-aware conversations, mimicking human interactions. They remember customer preferences and history to provide relevant responses like a human agent would.
  • Simple, volume-based pricing: Plivo charges a flat fee per conversation rather than per message, making costs predictable and scalable. Volume discounts are available to lower your total spend as your messaging needs grow.
Image showing Plivo’s flat-fee per conversation pricing with volume discounts.
Plivo charges a flat fee per conversation with volume discounts.
  • Built-in compliance: Plivo ensures compliance with GDPR, HIPAA, PCI DSS, ISO 27001, and SOC 2 standards.
  • Guaranteed message delivery with fallback options: The platform delivers billions of messages annually and uses SMS and voice fallback channels to ensure your customers always receive important communications.
  • 24/7 availability: Plivo's AI agents provide instant, 24/7 assistance, answering questions, processing orders, and resolving customer issues.
  • Multilingual support: With support for 70+ languages, Plivo’s AI agents can engage with customers globally and offer a multilingual customer service experience.
  • E-commerce platform integrations: Integrate seamlessly with popular e-commerce platforms like Shopify, BigCommerce, WooCommerce, and Magento to deliver a unified customer experience across all touchpoints.

With Plivo’s vast carrier network spanning over 220 countries, businesses can significantly cut SMS costs by up to 70% while achieving threefold returns on investment. 

Many companies using Plivo CX have experienced remarkable results, earning an outstanding $71 for every dollar invested in their SMS marketing efforts.

Book a free demo today and see how Plivo’s AI WhatsApp agents can change your customer communication strategy.

Subscribe to Our Newsletter

Plivo’s cloud communications platform is backed by a robust, reliable, fault-tolerant.

Oops! Something went wrong while submitting the form.
Jun 3, 2021
5 mins

How to Receive a Phone Call in PHP with Laravel and Plivo

Voice API | Plivo | You can get started to Receive a Phone Call in PHP with Laravel and Plivo.

PHP SDK
Voice API
How To

Making an outbound phone call using the Plivo Voice platform is easy, but communication should be a two-way street. Customers should be able to call you back, and you should answer the calls and address their concerns. This guide shows you how to receive incoming calls on Plivo numbers and manage the call flow once a call reaches the Plivo voice platform. To see how to do this, we’ll build a Laravel application to receive an incoming call and greet the caller with a text-to-speech (TTS) message.

Prerequisites

Before you get started, you’ll need:

  • A Plivo account — sign up for one for free if you don’t have one already.
  • A voice-enabled Plivo phone number if you want to receive incoming calls. To search for and buy a number, go to Phone Numbers > Buy Numbers on the Plivo console.
  • Laravel and Plivo PHP packages.
  • ngrok — a utility that exposes your local development server to the internet over secure tunnels.

{{cta-style-1}}

Create a Laravel application to receive incoming calls and play a TTS message

First, you need to install Laravel if you haven’t installed it already. We suggest using Composer to install it. Add a new Laravel project with boilerplate code with the command composer create-project laravel/laravel receive_calls --prefer-dist. This will create a receive_calls directory with the necessary folders and files for development. Then change to the newly created “receive_calls” project directory and install the Plivo PHP package (composer require plivo/plivo-php).

Once you’ve installed Laravel and the Plivo PHP SDK, run php artisan make:controller ReceivecallController to create a Laravel controller to handle incoming calls on a Plivo number. To handle an incoming call, you need to return an XML document from the URL configured as the answer URL in the application assigned to the Plivo number. The PHP SDK can manage the XML document generation, and you can use the Speak XML element to play a text-to-speech message to the caller. Use this code:

<?php

namespace App\Http\Controllers;

require '../vendor/autoload.php';
use Plivo\RestClient;
use Plivo\XML\Response;
use Illuminate\Http\Request;

class ReceivecallController extends Controller
{
   // Speak XML to handle your first incoming call
   public function receiveCalls()
   {
       $response = new Response();
       $speak_body = "Hello, you just received your first call";
       $response->addSpeak($speak_body);
       Header('Content-type: text/xml');
       echo $response->toXML();
   }
}

Now, you need to add a route for the “receiveCalls” function in the ReceivecallController class. Open the routes/web.php file and add this line at the end of the file:

Route::match(['get', 'post'], '/receive_calls',
'App\Http\Controllers\ReceivecallController@receiveCalls');

Note: We need to add the route of the app to the “except” array to disable CSRF verification - app/Http/Middleware/VerifyCsrfToken.php`

<?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;

class VerifyCsrfToken extends Middleware
{
   /**
    * The URIs that should be excluded from CSRF verification.
    *
    * @var array
    */
   protected $except = [
       '/receive_calls'
   ];
}

Test the code locally

Now the ReceivecallController is ready to handle incoming calls to your Plivo number using Laravel and Plivo PHP SDK. To run the code on the Laravel server, use the command

$ php artisan serve

You should see your basic server application in action on http://127.0.0.1:8000/receive_calls.

Expose the local server to the internet using ngrok

Once you see the application working locally, the next step is to connect the application to the internet to return the XML document to process the incoming call. For that, we recommend using ngrok, which exposes local servers behind NATs and firewalls to the public internet over secure tunnels.

Install it and run ngrok on the command line, specifying the port that hosts the application on which you want to receive calls (8000 in this case, as our local Laravel application is running there):

$ ./ngrok http 8000

Ngrok will display a forwarding link that you can use as a webhook to access your local server over the public network.

Ngrok CLI

Test the link by opening the ngrok URL(https://6e4d127bf930.ngrok.io/receive_calls) in a browser. We used HTTPie to check the XML response from the ngrok URL.

XML document with Speak XML element

Connect the Laravel application to a Plivo number

The final step is to configure the application as a Plivo voice application and assign it to a Plivo number on which you want to receive incoming calls.

Go to the Plivo console and navigate to Voice > Applications > XML, then click on the Add New Application button in the upper right.

Provide a friendly name for the application — we used “App-Incoming-call” — and configure the ngrok URL https://6e4d127bf930.ngrok.io/receive_calls as the Answer URL. Select the HTTP verb as POST, then click Create Application.

Create Plivo App to handle incoming calls

Now go to Phone Numbers > Your Numbers and click on the number to which you want to assign the application. From the Plivo Application drop-down, choose the voice application you just created. Finally, click Update Number.

Assign the Plivo App to a Plivo Number

Test the application

Make a phone call to the Plivo number you selected. You should see that the Laravel application automatically greets the caller with the text-to-speech message configured in the app.

And that’s how simple it is to receive an incoming call on a Plivo number and handle it using XML documents using Plivo’s PHP SDK and a Laravel application. You can implement other use cases on the Plivo Voice platform, such as phone system IVR, call forwarding, and number masking, as your business requires.

Haven’t tried Plivo yet? Getting started is easy and only takes five minutes. Sign up today.

May 31, 2021
5 mins

Get ready to be STIRred and SHAKEN

STIR/SHAKEN goes into effect June 30. Here’s how Plivo will handle attestation and sign outbound calls as either Verified or Not Verified.

Fraud Prevention

If you read our blog post from a couple of months ago, you’re already familiar with STIR/SHAKEN — Secure Telephone Identity Revisited (STIR) and Signature-based Handling of Asserted Information Using toKENs (SHAKEN). They’re technical frameworks that fight call spoofing by authenticating the calling number.

The US Federal Communications Commission (FCC) has directed carriers to implement STIR/SHAKEN by June 30, 2021. Plivo will be ready; we’re already running a successful pilot program.

When we roll out STIR/SHAKEN support for inbound calls, we’ll validate attestation of calls to Plivo DIDs and toll-free numbers in the US, irrespective of whether they’re used for Voice or Zentrunk. For calls through the Voice API, we’ll pass the STIR/SHAKEN verification level as part of webhook requests to various URLs — answer_url, fallback_url, hangup_url, etc. For both Voice and Zentrunk calls, we’ll also show verification levels on the Plivo console and in Call Detail Reports.

Going in the other direction, we’ll sign all Voice and Zentrunk outbound calls to the US — unless a customer violates the rules:

  1. The calls breach the Plivo Fair Usage Policy.
  2. The calls are identified as unsolicited robocalls.
  3. Plivo gets a traceback request from the Industry Traceback Group about calls made by the customer.
  4. The calls have invalid caller IDs — for instance, if they don’t adhere to E.164 format or  have too many digits.

In these scenarios, Plivo may stop signing all calls initiated by the customer. That could lead to lower answer rates, because calls won’t be marked as Verified. Worst case, they could be marked as spam by receiving networks.

Verification levels for outbound calls

In the STIR/SHAKEN framework, a secure telephony identity (STI) governance authority issues digital certificates. STIR/SHAKEN provides three attestation levels that can be assigned by an STI authentication service, which represent how confident a service provider is in that the number’s owner is truly the one placing the call.

Plivo will sign outbound calls as Verified (attestation A) for calls that use a Plivo DID as caller ID. The DID used should be rented by the same Plivo account that originates the outbound calls. All other outbound calls, assuming they are signed at all, are signed Not Verified (attestation B or C).

We strongly encourage customers to use Plivo DIDs as caller ID to improve their STIR/SHAKEN verification levels.

How verification status maps to STIR attestations

For both outbound and inbound Voice API calls, Plivo will display the verification status of a call as a parameter called Stir Verification, which can have one of three values:

  • Verified means the call is from a Verified caller who has authorized access to the customer’s caller ID, and hence should be treated with confidence. Verified is equivalent to attestation level A.
  • Not Verified means that, for this call, either the caller is not Verified, or it’s uncertain whether they have access to the caller ID used, or both. Not Verified means the call received attestation level B or C.
  • Not Applicable means STIR/SHAKEN doesn’t apply to this call, as would be the case if a call is not addressed to a US number or if it’s a cloud call (WebRTC or SIP).

How to access verification status

Voice and Zentrunk customers have several ways to access STIR verification statuses.

Voice API

Plivo Voice customers can access verification values on the Voice > Calls page of the console as part of call logs, as part of CDR exports, and via Voice APIs in several ways:

Webhook Callbacks

We’ve added a new STIRVerification parameter as part of status update JSON code sent to these callback URLs:

  • answer_url
  • fallback_url
  • hangup_url

Parameter:

StirVerification

Possible values:

“Verified”
“not_verified”
"Not Applicable"

We’ve also added the parameter as part of call_status_callback_url for multiparty call events:

Parameter:

StirVerification

Event: Initialized

Possible values: “Not Applicable”

Event: Ringing, Answered, or Hangup

Possible values: Value of the Stir_Verification parameter of CallUUID

Voice API Call Object

You can also access STIR verification as part of the response of the Get CDR API call:

Parameter: 

StirVerification

Possible values: 

“Verified”

“not_verified”

“Not Applicable”

Zentrunk

Zentrunk customers will be able to see STIR verification values in the several ways:

Console

On the Zentrunk > Logs page as part of Call Detail Records (CDR).

Custom SIP header

As part of a new SIP header:

SIP header: 

X-Plivo-Stir-Verification

Possible values: 

“Verified”

“Not Verified”

“Not Applicable”

P-Asserted-ID Header

Zentrunk customers can also use the SIP verstat parameter as part of the P-Asserted-ID header:

P-Asserted-ID Header: 

P-Asserted-Identity: 

<sip:+13339990000;verstat=TN-Validation-Passed@67.xxx.x.xx:5060>  

Possible values: 

verstat=No-TN-Validation 

verstat=TN-Validation-Passed

verstat=TN-Validation-Failed

Upcoming attestation refinements

Soon, Plivo will start taking into consideration more factors to determine the attestation level for outbound calls, including (but not limited to):

  1. Results of Know Your Customer (KYC) validation, a feature coming to the Plivo console and API in the near future.
  2. Customers’ own DIDs sourced from other providers and whitelisted with Plivo. We plan to enable whitelisting through the Plivo console and the API in the near future.
  3. The confidence Plivo has in customer traffic patterns not constituting fraudulent and unsolicited robocall traffic.

Looking forward to less spoofing

We believe STIR/SHAKEN will have a big impact in preventing caller ID spoofing and containing unsolicited robocalls, and we’re excited to join the fight. Talk to a Plivo expert for help getting started.

May 29, 2021
5 mins

How to Make and Receive Phones Call Using Plivo’s Voice API and .NET

How to make and receive outgoing and incoming voice calls using .NET with the Plivo Voice API.

.NET SDK
Voice API
How To

Your company has settled on Plivo to handle its voice and messaging communications, and now it’s your job to start integrating Plivo into your company’s applications. Don’t worry — Plivo has an SDK to help you out. Let’s see how to make outbound calls and handle incoming calls through Plivo in a .NET Core application.

Install the Plivo SDK

We’ll presume you already have .NET Core and .NET CLI installed. Change to the directory into which you want to install the Plivo .NET Core SDK and run

$ dotnet new console
$ dotnet add package Plivo --version 5.3.0

Find your Auth ID and Auth Token

You have to have proper credentials before you can use the Plivo API. We provide an Auth ID and Auth Token in the Account section at the top of the overview page of the Plivo console.

Find Your Auth Credentials on Plivo Console

Choose a phone number

You need an voice-enabled Plivo phone number if you want to receive incoming calls. Check the Numbers screen of the Plivo console to see what numbers you have available. You can also rent numbers from this screen.

Buy a New Plivo Number

Use PHLO to set up an outbound call

Now you can turn to PHLO, Plivo’s visual workflow design studio, to set up the workflow for an outbound call. Click on the PHLO icon on the left-side navigation bar, then on Create New PHLO. In the window that pops up, click Build My Own.

Let’s start with a very simple workflow. From the list of components on the left side, drag and drop the Initiate Call component onto the canvas, then connect the Start node to the Initiate Call node using the API Request trigger state.

Now you can add configuration information for the call in the right pane. Valid phone numbers begin with a plus sign and a country code. Add a caller ID number in the From field and a destination number in the To field, then click Validate to save the configuration.

PHLO lets you use variables for From and To values, but we’re keeping it simple for this example.

Now drag the Play Audio component onto the canvas. Connect the Initiate Call node to Play Audio using the Answered trigger state. In the Configuration panel, enter the text you want to play for the call recipient, then click Validate.

Create a PHLO for outbound calls

That’s all we’re going to do for now — we told you it was simple. Give the PHLO a name by clicking on the pencil icon in the upper left, then click the Save button in the upper right.

Run the PHLO to make a call

Now you can trigger the PHLO and test it out. Copy the PHLO ID from the end of the URL of the workflow you just created. You’re also going to need your Auth ID and Auth Token. Open the file Program.cs in the CS project and paste this code into it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
using System;
using Plivo;

namespace test_PHLO
{
    class Program
    {
        public static void Main(string[] args)
        {
            var phloClient = new PhloApi("<auth_id>", "<auth_token>"); 
            var phloID = "<phlo_id>"; 
            var phlo = phloClient.Phlo.Get(phloID);   
            Console.WriteLine(phlo.Run());
        }
    }
}

Substitute actual values for <auth_id>, <auth_token>, and <PHLO_ID>. Save the file and run it with the commandBoom — you’ve made an outbound call.

$ dotnet run

Set up inbound calls

Of course outbound calls are only half of the equation. Plivo supports inbound calls as well. To see how, let’s create another PHLO and again specify Build My Own. This time, drag the Play Audio component onto the canvas and connect the Start node to it using the Incoming Call trigger state. In the Configuration panel, enter some text to speak to the caller when the call is answered, then click Validate to save the configuration. Give this PHLO a name, then click Save.

Before you can receive a call using this PHLO, you have to assign it to a Plivo number. Go back to the Plivo console and click on Phone Numbers on the left nav bar. From the list of Your Numbers, click on the number you want to use. On the next screen, from the Application Type dropdown, choose PHLO. From the PHLO Name dropdown, choose the PHLO you just created. Then click Update Number at the bottom of the screen.

Create a PHLO to receive incoming call

Guess what? You’re done! You don’t have to run a program for this PHLO to work. Just call the Plivo number you specified and you should hear the message you configured read by Plivo’s text-to-speech processor.

Conclusion

And that’s all there is to sending and receiving voice calls using Plivo’s .NET SDK. Don’t use .NET? Don’t worry — we have SDKs for Java, Python, PHP, Ruby, .NET Core, .NET Framework, and Go.

Haven’t tried Plivo yet? Getting started takes only five minutes. Sign up today.

May 28, 2021
5 mins

How to Receive and Respond to Incoming SMS Messages in PHP with Laravel and Plivo

SMS API | Plivo | You can get started to Receive and Respond to Incoming SMS Messages in PHP with Laravel and Plivo.

PHP SDK
SMS API
How To

Sending an outbound message using the Plivo SMS platform is easy, but communication should be a two-way street. Customers should be able to text you, and you should acknowledge their messages and address their concerns. To do this, you can build a PHP Laravel application to receive and respond to incoming SMS messages on a Plivo phone number. In this post, we walk you through how to implement this.

Prerequisites

Before you get started, you’ll need:

  • A Plivo account — sign up for one for free if you don’t have one already.
  • An SMS-enabled Plivo phone number as you want to receive incoming SMS messages. To search for and buy an available number, go to Phone Numbers > Buy Numbers on the Plivo console.
  • Laravel and Plivo PHP packages.
  • ngrok — a utility that exposes your local development server to the internet over secure tunnels.

Create a Laravel application to receive SMS messages

First, you need to install Laravel if you haven’t installed it already. We suggest using Composer to install it. Add a new Laravel project with boilerplate code with the command composer create-project laravel/laravel receive_sms --prefer-dist. This will create a receive_sms directory with the necessary folders and files for development. Then change to the newly created “receive_sms” project directory and install the Plivo PHP package (composer require plivo/plivo-php).

Once you’ve installed Laravel and the Plivo PHP SDK, run php artisan make:controller SMSController to create a Laravel controller to handle incoming SMS messages on a Plivo number. Use this code:

<?php

namespace App\Http\Controllers;
require '../vendor/autoload.php';
use Illuminate\Http\Request;

class SMSController extends Controller
{
    public function receivesms()
    {
         $from_number = $_REQUEST["From"];
         $to_number = $_REQUEST["To"];
         $text = $_REQUEST["Text"];
         echo("Message received - From $from_number, To: $to_number, Text: $text");
    }
}

Now, you need to add a route for the “receivesms” function in the SMSController class. Open the routes/web.php file and add this line at the end of the file:

Route::match(['get', 'post'], '/receivesms', 'App\Http\Controllers\SMSController@receivesms');

Return a Message XML document to reply to incoming messages

To reply to an incoming SMS message, you need to return an XML document from the URL configured as the message_url in the application assigned to the Plivo number. The PHP SDK can manage the XML document generation, and you can use the Message XML element to reply to incoming SMS messages. Use this code:

<?php

namespace App\Http\Controllers;
require '../vendor/autoload.php';
use Plivo\RestClient;
use Plivo\XML\Response;
use Illuminate\Http\Request;

class SMSController extends Controller
{
    public function receivesms()
    {
         $from_number = $_REQUEST["From"];
         $to_number = $_REQUEST["To"];
         $text = $_REQUEST["Text"];
         echo("Message received - From $from_number, To: $to_number, Text: $text");
    }

    public function replysms()
    {
        $number = $_REQUEST["From"];
        $to = $_REQUEST["To"];
        $text = $_REQUEST["Text"];
        $response = new Response();
        $params = array(
            'src' => $to,
            'dst' => $number,
            'callbackUrl' => "https://www.foo.com/sms_status/",
            'callbackMethod' => "POST"
        );
        $message_body = "Thank you, we have received your request.";
        $response->addMessage($message_body, $params);

        Header('Content-type: text/xml');
        return $response->toXML();
    }
}

As we did earlier, we need to add a route for the “replysms” function in the SMSController class. Open the routes/web.php file and add this line at the end of the file:

Route::match(['get', 'post'], '/replysms', 'App\Http\Controllers\SMSController@replysms');

Note: We need to add the route of the app to the “except” array to disable CSRF verification - app/Http/Middleware/VerifyCsrfToken.php

<?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;

class VerifyCsrfToken extends Middleware
{
    /**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array
     */
    protected $except = [
        '/receivesms',
        '/replysms'
    ];
}

Test the code locally

Now the SMSController is ready to handle incoming SMS messages to your Plivo number using Laravel and Plivo PHP SDK. To run the code on the Laravel server, use the command

You should see your basic server application in action on http://127.0.0.1:8000/replysms.

Expose the local server to the internet using ngrok

Once you see the application working locally, the next step is to connect the application to the internet to receive and reply to messages. For that, we recommend using ngrok, which exposes local servers behind NATs and firewalls to the public internet over secure tunnels. Install it and run ngrok on the command line, specifying the port that hosts the application on which you want to receive messages (8000 in this case, as our local Laravel application is running there):

Ngrok will display a forwarding link that you can use as a webhook to access your local server over the public network.

Ngrok CLI

Test the link by opening the ngrok URL(https://b82335d346bb.ngrok.io/replysms) in a browser. We used HTTPie to check the XML response from the ngrok URL.

XML document with Message XML element

Connect the Laravel application to a Plivo number

The final step is to configure the app as a Plivo messaging application and assign it to a Plivo number on which you want to receive SMS messages.

Go to the Plivo console and navigate to Messaging > Applications > XML, then click on the Add New Application button in the upper right.

Provide a friendly name for the app — we used “App-Incoming-SMS” — and configure the ngrok URL https://b82335d346bb.ngrok.io/replysms as the Message URL. Select the HTTP verb as POST, then click Create Application.

Create Plivo App to handle incoming SMS messages

Now go to Phone Numbers > Your Numbers and click on the number to which you want to assign the application. From the Plivo Application drop-down, choose the message application you just created. Finally, click Update Number.

Assign the Plivo App to a Plivo Number

Test the application

Send an SMS to the Plivo number you selected. You should see that the Laravel application automatically sends a reply back to your mobile number.

And that’s how simple it is to receive and respond to incoming SMS messages using Plivo’s PHP SDK and a Laravel application.

Haven’t tried Plivo yet? Getting started is easy and only takes five minutes! Sign up today.

May 25, 2021
5 mins

How to Receive a Phone Call in Ruby with Rails and Plivo

Voice API | Plivo | You can get started to Receive a Phone Call in Ruby with Rails and Plivo.

Ruby SDK
Voice API
How To

Making an outbound phone call using the Plivo Voice platform is easy, but communication should be a two-way street. Customers should be able to call you back, and you should answer the calls and address their concerns. This guide shows you how to receive incoming calls on Plivo numbers and manage the call flow once a call reaches the Plivo voice platform. To see how to do this, we’ll build a Ruby on Rails application to receive an incoming call and greet the caller with a text-to-speech (TTS) message.

Prerequisites

Before you get started, you’ll need:

  • A Plivo account — sign up for one for free if you don’t have one already.
  • A voice-enabled Plivo phone number if you want to receive incoming calls. To search for and buy a number, go to Phone Numbers > Buy Numbers on the Plivo console.
  • Rails and Plivo Ruby packages.
  • ngrok — a utility that exposes your local development server to the internet over secure tunnels.

Create a Rails application to receive incoming calls and play a TTS message

First, you need to install Rails if you haven’t installed it already. Use the command gem install rails, or use bundler or RVM to install it. Add a new Rails project with boilerplate code with the command rails new myrailsapp. This will create a myrailsapp directory with the necessary folders and files for development. Then add the Plivo Ruby gem (gem ‘plivo’, ‘~> 4.16.0’) as a dependency in the gemfile and use the command bundle install to install it.

Once you’ve installed Rails and the Plivo Ruby SDK, change to the newly created myrailsapp project directory and run rails generate controller Plivo receive_call to create a Rails controller to handle incoming calls on a Plivo number. To handle an incoming call, you need to return an XML document from the URL configured as the answer URL in the application assigned to the Plivo number. The Ruby SDK can manage the XML document generation, and you can use the Speak XML element to play a text-to-speech message to the caller. Use this code:

class PlivoController < ApplicationController
 def receive_call
   response = Plivo::XML::Response.new
   speak_body = 'Hello, you just received your first call'
   response.addSpeak(speak_body)

   xml = Plivo::XML::PlivoXML.new(response)
   render xml: xml.to_xml
 end
end

Test the code locally

To run the code on the rails server, use the command $ rails server. You should see your basic server application in action on http://127.0.0.1:3000/plivo/receive_call/.

Expose the local server to the internet using ngrok

Once you see the application working locally, the next step is to connect the application to the internet to return the XML document to process the incoming call. For that, we recommend using ngrok, which exposes local servers behind NATs and firewalls to the public internet over secure tunnels.

Install ngrok, but before you start the ngrok service, whitelist ngrok by adding it to the config.hosts list in the config/environments/development.rb file with this command. You’ll face a Blocked host error if you fail to add it.

# whitelist ngrok domain
config.hosts << /[a-z0-9]+\.ngrok\.io/

Now run ngrok on the command line, specifying the port that hosts the application on which you want to receive messages (3000 in this case, as our local Rails application runs there):

$ ./ngrok http 3000

Ngrok will display a forwarding link that you can use as a webhook to access your local server over the public network.

Ngrok CLI

Test the link by opening the ngrok URL (https://d3498206694e.ngrok.io/plivo/receive_call/) in a browser. We used HTTPie to check the XML response from the ngrok URL.

XML document with Speak XML element

Connect the Rails application to a Plivo number

The final step is to configure the application as a Plivo voice application and assign it to a Plivo number on which you want to receive incoming calls.

Go to the Plivo console and navigate to Voice > Applications > XML, then click on the Add New Application button in the upper right.

Provide a friendly name for the application — we used “App-Incoming-call” — and configure the ngrok URL https://d3498206694e.ngrok.io/plivo/receive_call/ as the Answer URL. Select the HTTP verb as POST, then click Create Application.

Create Plivo App to handle incoming calls

Now go to Phone Numbers > Your Numbers and click on the number to which you want to assign the application. From the Plivo Application drop-down, choose the voice application you just created. Finally, click Update Number.

Assign the Plivo App to a Plivo Number

Test the application

Make a phone call to the Plivo number you selected. You should see that the Rails application automatically greets the caller with the text-to-speech message configured in the app.

And that’s how simple it is to receive an incoming call on a Plivo number and handle it using XML documents using Plivo’s Ruby SDK and a Rails application. You can implement other use cases on the Plivo Voice platform, such as phone system IVR, call forwarding, and number masking, as your business requires.

Haven’t tried Plivo yet? Getting started is easy and only takes five minutes. Sign up today.

May 25, 2021
5 mins

How IVR Systems Can Enhance Your Contact Center Customer Service

IVR systems helps contact centers by providing increased operational efficiency, stronger brand image, and better customer insights.

IVR

Automation helps businesses deliver richer customer experiences, and one of the best ways to achieve automation in a contact center is to deploy an interactive voice response (IVR) system.

We’re all familiar with that voice telling us to “press 0 for representative” — a voice menu system that uses speech recognition or Touch-Tone input to route callers to an appropriate agent. The concept is simple, but your company’s IVR system can be as sophisticated as you’d like, with customized greetings, messages, and prompts, so that when customers call you, they get a very personalized experience.

By leveraging IVR, your business can route callers to the most appropriate department or the agent most qualified to meet their needs, reducing costs and improving productivity. Among its many advantages, IVR can provide increased operational efficiency, stronger brand image, and better customer insights.

Benefits of IVR Systems in Contact Centers

IVR can automate simple tasks like account balance inquiries or bill payments, taking the burden of these administrative tasks off the plates of call center agents. This not only reduces wait times for complex problems but also allows agents to dedicate more time to resolving more complex issues, improving the overall quality of service. 

For contact centers, IVRs increase efficiency and lower operational costs, as fewer live agents are required to handle basic inquiries. Additionally, IVR systems can be designed to gather valuable customer data during interactions, which can be used for better routing, improved self-service options, and overall enhanced customer experiences.

1. Increased operational efficiency

Maximizing efficiency is essential in today’s competitive business environment. It’s not cost-effective to have agents handle every customer phone call. You shouldn’t need to pay employees to answer simple questions like “How late are you open?” or “What’s my account balance?” IVR provides an automated say to handle these simple questions, and lets you send callers to agents for more complicated interactions.

IVR also increases first contact resolution rates, because a good IVR system can direct callers to the department or even the specific agent who’s most capable of meeting their needs. It can lower the likelihood of having to transfer callers between agents, increasing customer service efficiency.

2. Stronger brand image

Like your logo or website design, the voice, music, scripts, and tone you choose for your IVR system convey your brand and business personality. Aligning your IVR menus to be consistent with your other brand elements builds a more powerful image for your customers. And well-configured call flows are a strong indication of your commitment to the best customer experience.

Speaking of brand image, you can add marketing messages to your IVR system for customers to listen to. Customers on hold are in a perfect position to absorb your marketing messages.

3. Better customer insights

You can deliver the best customer experience only if you understand how your customers interact with you. Marketers can leverage IVR systems to learn more about their customers through polls and surveys. IVR systems let marketers gather customer likes, interests, and demographics. With such rich customer data, businesses can conduct post-campaign analysis to determine which demographics responded most favorably, and adjust future messaging accordingly.

Tips for better IVR menus

Want to improve the effectiveness of your IVR systems? Follow these best practices:

  • Keep your script short and sweet. Keep menu options minimal and make it easy for callers to resolve issues themselves, or speak to an agent who can.
  • Offer a direct route to a supervisor where needed.
  • Integrate the IVR system with your CRM system — this lets you personalize the interaction and prioritize high-value callers.
  • Offer the option of a call-back when the call queue is long.
  • Offer both speech recognition and Touch-Tone as options for callers.

Build an IVR system with Plivo

Plivo’s Voice API puts you in control of your IVR system so you can create exceptional customer experiences while reducing operational costs. We provide your developers with the ability to easily integrate automatic speech recognition (ASR), so you can respond to customers however and whenever they want to connect with you.

Setting up an IVR phone tree with Plivo is simple. Configure one of your Plivo numbers to send a request to your web application when you receive a call. Your application should respond to the request with a top-level menu. Plivo plays the menu options and gathers input from the caller. When the caller makes a selection, Plivo uses the logic you’ve defined to route the call to the appropriate agent or the front desk. Phone numbers can be hard coded or read from a database, and endpoints can be hard or soft phones. To get a full breakdown of how it works, check out our product documentation.

IVR systems can not only enhance customer experience, but also improve agent success while reducing operational costs. To maximize the benefits of interactive voice response, choose a solution like Plivo to help you capture and leverage customer information to deliver a seamless, personalized experience.

Haven’t tried Plivo yet? Getting started is easy! Sign up today.

May 24, 2021
5 mins

4 Ways Retailers Can Leverage MMS for a Better Customer Experience

Four ways retailers can leverage MMS for a better customer experience: coupons and promotions, personal shopping, product registration, branded messaging

MMS API
SMS Marketing
Retail

Businesses do more than just supply products or services. During the pandemic we saw that they also supply connections. To strengthen those connections, businesses are starting to open new channels of communication.

Retailers and ecommerce brands especially have begun finding creative ways of using mobile communication throughout the customer journey, so that their consumers’ interactions with their brand are more meaningful. They’re working on delivering personalized offers through mobile channels, providing timely communications during purchases, and measuring user satisfaction after customers begin using the product.

If MMS marketing wasn’t already top of mind for retailers before the pandemic cut into in-person shopping, it certainly is now. Retailers’ ability to leverage MMS to send personalized, targeted communication and provide rich mobile experiences results in higher response rates than phone calls or email.

Every brand today, no matter what space it’s in, should take advantage of consumers’ mobile capabilities. MMS can reach mobile customers and generate a high level of engagement.

Here are four ways retailers can leverage MMS for a better customer experience.

Coupons and promotions

Consumers redeem SMS-delivered coupons about 10 times more than other coupon types, and 50% of US consumers make a purchase after receiving an advertising text, a discount coupon, or a QR code.

Messaging with pictures and video puts a new spin on a format that already works. Retailers can use MMS to share scannable QR codes and coupon picture messages that customers can redeem in stores, and rich messaging features like GIFs, videos, and sound clips add to the experience. When you package pictures with your promotion you have a recipe for huge engagement, and you raise the potential that the promotion itself is shared.

Today’s consumers have an expectation of getting what they want when they want it, and time is of the essence. Sharing timely, targeted offers via MMS is the optimal way to meet that expectation and drive higher levels of purchases.

Personal shopping

Personal shopping is all about smoothing away shopping hassles by understanding customers’ personal styles and recognizing items they’ll like. People already use their smartphones for shopping; delivering assistance via MMS is a natural enhancement.

You can kick-start an interaction with automated SMS messaging, and if a customer wants to see what an item looks like, you can bring in MMS for the assist. Imagine how much easier a digital personal shopping experience is when consumers can quickly exchange product pictures with retail salespeople. Instead of describing a style verbally, sales staff can send a photo. The two-way, conversational nature of texting, paired with the visual benefits of MMS, allows retailers to go back and forth with customers easily, ask clarifying questions, and add a personal touch to ultimately make a sale. Think of it as a premium service for loyal customers when they need help putting together an outfit remotely.

Product registration

Product registration reminders are a powerful but often overlooked messaging interaction opportunity. If you sell a product with a warranty or offer post-purchase offers and support, you’ll want to get customers engaged straightaway. The trouble is, product registration can be a boring, manual process, and sometimes requires a phone call.

Instead, invite buyers to register their products the easy way: by sending you a photo of a bar code associated with the product. No hassle, no typos, just a convenient way to show interest in some after-sale engagement.

Branded messaging

SMS used to be a text-only experience. Now, when you use MMS, you can send a message that arrives complete with your brand logo. Images help you get noticed, and MMS gives your users a safe, verified messaging experience, without any kind of technical intervention needed on either side.

By messaging customers through their mobile devices, retailers can deliver highly targeted marketing communications to shoppers and open the door to new revenue opportunities and long-term engagement.

Picking an MMS provider

Since MMS is such a personal form of communication, we advise businesses to be thoughtful about when and how they use it. A messaging strategy loses its power if a business inundates consumers with irrelevant messages or sends messages too often or at inconvenient times, such as when they’re settling into bed for the night. You want an API solution that makes it easy for developers to programmatically send and receive messages, that also leverages the cloud for scalability, and that runs on a global carrier network to intelligently and cost-effectively route messages.

Plivo’s MMS API platform makes it easy to send and receive pictures on all US and Canadian phone number, with no wait times or upfront costs. Features include:

Multiple sender types: You can use long code and toll-free numbers to send and receive MMS messages across the US and Canada.

Multimedia formats: Plivo supports sending and receiving image (JPEG, GIF), audio (MP3 and WAV), and video (MP4) files of many types for a rich multimedia experience.

Multimedia storage: Plivo provides multimedia storage for both inbound and outbound MMS messages to enable easy access and reuse.

Message queuing: Plivo’s MMS API queues and retries your concurrent messaging requests to comply with carrier regulations and offer increased deliverability.

Plivo enables businesses of all types and sizes to create a unique, personalized experience for their customers by making use of MMS and its versatility and support for a wide range of media formats. Adding audio and visual components can enhance simple text, leading to higher engagement and increased responsiveness from your customers.

Learn all about sending and receiving MMS from our product documentation. Haven’t tried Plivo yet? Getting started is easy. Sign up today!

May 20, 2021
5 mins

How to Receive and Respond to Incoming SMS Messages in Ruby with Rails and Plivo

SMS API | Plivo | You can get started to Receive and Respond to Incoming SMS Messages in Ruby with Rails and Plivo.

Ruby SDK
SMS API
How To

Sending an outbound message using the Plivo SMS platform is easy, but communication should be a two-way street. Customers should be able to text you, and you should acknowledge their messages and address their concerns. To do this, you can build a Ruby on Rails application to receive and respond to incoming SMS messages on a Plivo phone number. In this post, we walk you through how to implement this.

Prerequisites

Before you get started, you’ll need:

  • A Plivo account — sign up for one for free if you don’t have one already.
  • An SMS-enabled Plivo phone number, as you want to receive incoming SMS messages. To search for and buy an available number, go to Phone Numbers > Buy Numbers on the Plivo console.
  • Rails and Plivo Ruby packages.
  • ngrok — a utility that exposes your local development server to the internet over secure tunnels.

Create a Rails application to receive SMS messages

First, you need to install Rails if you haven’t installed it already. Use the command gem install rails, or use bundler or RVM to install it. Add a new Rails project with boilerplate code with the command rails new myrailsapp. This will create a myrailsapp directory with the necessary folders and files for development. Then add the Plivo Ruby gem (gem ‘plivo’, ‘~> 4.16.0’) as a dependency in the gemfile and use the command bundle install to install it.

Once you’ve installed Rails and the Plivo Ruby SDK, change to the newly created myrailsapp project directory and run rails generate controller Plivo sms to create a Rails controller to handle incoming SMS messages on a Plivo number. Use this code:

class PlivoController < ApplicationController
 def sms
   from_number = params[:From]
   to_number = params[:To]
   text = params[:Text]
   puts "Message received - From: #{from_number}, To: #{to_number}, Text: #{text}"
 end
end

Return a Message XML document to reply to incoming messages

To reply to an incoming SMS message, you need to return an XML document from the URL configured as the Message URL in the application assigned to the Plivo number. The Ruby SDK can manage the XML document generation, and you can use the Message XML element to reply to incoming SMS messages. Use this code:

class PlivoController < ApplicationController
 def sms
   from_number = params[:From]
   to_number = params[:To]
   text = params[:Text]
   puts "Message received - From: #{from_number}, To: #{to_number}, Text: #{text}"
 end
 def reply
   from_number = params[:From]
   to_number = params[:To]
   text = params[:Text]
   response = Plivo::XML::Response.new
   params = {
     src: to_number,
     dst: from_number,
   }
   message_body = "Thank you, we have received your request"
   response.addMessage(message_body, params)
   xml = Plivo::XML::PlivoXML.new(response)
   puts xml.to_xml
   render xml: xml.to_xml
 end
end

Now open the config/routes.rb file and add the route for this reply function. The routes would become:

Rails.application.routes.draw do
 get 'plivo/sms'
 get 'plivo/reply'
end

Test the code locally

To run the code on the rails server, use the command

$ rails server

You should see your basic server application in action on http://127.0.0.1:3000/plivo/reply/.

Expose the local server to the internet using ngrok

Once you see the application working locally, the next step is to connect the application to the internet to receive and reply to messages. For that, we recommend using ngrok, which exposes local servers behind NATs and firewalls to the public internet over secure tunnels.

Install ngrok, but before you start the ngrok service, whitelist ngrok by adding it to the config.hosts list in the config/environments/development.rb file with this command. You’ll face a Blocked host error if you fail to add it.

Now run ngrok on the command line, specifying the port that hosts the application on which you want to receive messages (3000 in this case, as our local Rails application runs there):

Ngrok will display a forwarding link that you can use as a webhook to access your local server over the public network.

Ngrok CLI

Test the link by opening the ngrok URL (https://dd10ca394535.ngrok.io/plivo/reply/) in a browser. We used HTTPie to check the XML response from the ngrok URL.

XML document with Message XML element

Connect the Rails application to a Plivo number

The final step is to configure the application as a Plivo messaging application and assign it to a Plivo number on which you want to receive SMS messages.

Go to the Plivo console and navigate to Messaging > Applications > XML, then click on the Add New Application button in the upper right.

Provide a friendly name for the app — we used “App-Incoming-SMS” — and configure the ngrok URL https://dd10ca394535.ngrok.io/plivo/reply/ as the Message URL. Select the HTTP verb as POST, then click Create Application.

Create Plivo App to handle incoming SMS messages

Now go to Phone Numbers > Your Numbers and click on the number to which you want to assign the application. From the Plivo Application drop-down, choose the message application you just created. Finally, click Update Number.

Assign the Plivo App to a Plivo Number

Test the application

Test the application by sending an SMS message to the Plivo number you selected. You should see that the Rails application automatically sends a reply back to your mobile number.

And that’s how simple it is to receive and respond to incoming SMS messages using Plivo’s Ruby SDK and a Rails application.

Haven’t tried Plivo yet? Getting started is easy and only takes five minutes! Sign up today.

May 17, 2021
5 mins

How to Send MMS in Node.js using Plivo's Messaging API

SMS API | Plivo | You can get started to send MMS, receive MMS, forward MMS, etc. using Node.js programming language.

Node.Js SDK
SMS API
MMS API
How To

Your company has settled on Plivo to handle its voice and messaging communications, and now it’s your job to start integrating Plivo into your company’s applications. Don’t worry — Plivo has an SDK to help you out. Let’s see how to send and receive MMS through Plivo in a Node.js application.

Install the Plivo SDK and Express.js Framework

We’ll presume you already have your Node.js environment set up. Change to the directory into which you want to install the Plivo Node.js SDK and run

$ npm i -S plivo express body-parser

Find your Auth ID and Auth Token

You have to have proper credentials before you can use the Plivo API. We provide an Auth ID and Auth Token in the Account section at the top of the overview page of the Plivo console.

Find Your Auth Credentials on Plivo Console

Choose a phone number

You need an MMS-enabled Plivo phone number to send MMS to the US and Canada, the two countries where Plivo supports sending MMS. Check the Phone Numbers screen of your Plivo console to see what numbers you have available and which of them support MMS capabilities. You can also buy numbers from this screen.

Buy a New MMS-enabled Plivo Number

Send an MMS message

Now you’re ready to start. Create a file called SendMMS.js and paste in this code:

let plivo = require('plivo');
let client = new plivo.Client('<auth_id>', '<auth_token>');
client.messages.create({
    src: "+14151234567", //from
    dst: "+14157654321", // to
    text: "Hello, from Nodejs", // text
    type: "mms",
    media_urls: ["https://media.giphy.com/media/26gscSULUcfKU7dHq/source.gif"],
    media_ids: ["801c2056-33ab-499c-80ef-58b574a462a2"]
}).then(function(message_created) {
    console.log(message_created)
}).catch(function(error) {
    console.log(error);
});

Replace the placeholders auth_id and auth_token with actual values from the Plivo console. Save the file and run it with the command

$ node SendMMS.js

Note: If you’re using a Plivo trial account, you can send messages only to phone numbers that have been verified with Plivo. You can verify a phone number using the Sandbox Numbers page of the console. Also, if you want to upload your media files to Plivo and use them, you can upload the file on the Messaging > MMS Media Upload page of the console.

Receive an MMS message

Of course, sending messages is only half of the equation. When someone sends an MMS message to your US or Canada Plivo phone number, you can receive it on your server by setting a Message URL in your Plivo application. Plivo will send the message along with other parameters, including the Media_URL(s), to your Message URL.

Use this code to start a local server:

Save this code in any file — we’ll call ours receive_mms.js. To run this file on the server, go to the folder where this file resides and issue the command

You should see your basic server app in action on http://localhost:3000/receive_mms/.

That’s fine for testing, but it’s not much good if you can’t connect to the internet to receive incoming messages and handle callbacks. For that, we recommend using ngrok, which exposes local servers behind NATs and firewalls to the public internet over secure tunnels. Install it and run ngrok on the command line, specifying the port that hosts the application on which you want to receive messages:

Ngrok will display a forwarding link that you can use as a webhook to access your local server using the public network.

Sample ngrok CLI

Now you can create an application to receive MMS messages (follow our Quickstart guide for details).

Conclusion

And that’s all there is to sending and receiving MMS messages using Plivo’s Node.js SDK. Don’t use Node.js? Don’t worry — we have SDKs for Java, Python, PHP, Ruby, .NET Core, .NET Framework, and Go.

Haven’t tried Plivo yet? Getting started is easy and only takes five minutes. Sign up today.

It’s easy to get started.
Sign up for free.

Create your account and receive trial credits or get in touch with us.

Grid
Grid