Plivo’s WhatsApp API: Onboarding Made Simple

Plivo’s WhatsApp API: Onboarding Made Simple

Plivo’s WhatsApp Business API is designed to make it easy to send and receive WhatsApp messages to your audience. Getting started with Plivo’s WhatsApp API is simple, even for non-technical users. Here’s how to onboard your WhatsApp Business Account (WABA), register your number, and begin sending messages in seconds.

Step 1: Meet our prerequisites

There are several prerequisites to using our API. Before you can send your first message, check these steps off your list. 

  • Sign up for a Plivo account if you haven’t already. We’ll give you some usage credits so you can get started. Once you’ve used them up, set up payment details to ensure you have funds in your account.
  • Make sure you have an active Meta Business Suite account. If you don’t have one yet, set one up through Meta Business Suite or via embedded signup in the Plivo console — learn how in our guide.
  • Make sure you have an active Whatsapp Business Account (WABA) that you can map to your Plivo account. Use the Embedded Signup flow from within Plivo Console to create a new WABA or select an existing account.
  • Make sure you have a phone number that can be used to verify your account with a one-time passcode.

Once you’ve ticked off these prerequisites, you can start using WhatsApp as a channel in Plivo’s Messaging API.

Step 2: Onboard your WhatsApp Business Account

Next, create a new WABA or link an existing WABA from the WhatsApp landing page on the Plivo console. Choose which option you prefer to open Meta’s embedded signup flow. This flow will take you through the steps to connect your WABA to Plivo, where you can manage all your communications in one view within the console. 

Step 3: Verify Meta onboarding

When you have completed Meta’s signup flow, the WABA will be shown in your Plivo console. However, to verify that onboarding was successful, you can also navigate to your Meta Business Account, visit Business Settings, and click on WhatsApp Accounts. Go to the Partners tab. You should see Plivo included on your partners list.

Step 4: Get your first template approved

Meta requires you to use approved templates to initiate WhatsApp messages to your audience. Choose the best fit from Meta's list of templates according to your business needs. Note that the message template determines your conversation type, which also determines how you will be charged. Meta charges different fees for different types of conversations. 

Expect that Meta will take up to 24 hours to approve new templates. If you’re looking to launch your WhatsApp channel quickly, we recommend sticking to Meta’s specific template guidelines. Use the “Sync Templates from WhatsApp” function in your Plivo console to fetch the latest template details. 

Step 5: Send your first WhatsApp message! 

When your template is approved, you’re all set to use our API to send your first message. Create a file called send_whatsapp.js and paste into it this code.


var plivo = require('plivo');

var client = new plivo.Client("""", """");

const template = {
          ""name"": ""sample_purchase_feedback"",
          ""language"": ""en_US"",
          ""components"": [
            {
              ""type"": ""header"",
              ""parameters"": [
                {
                  ""type"": ""media"",
                  ""media"": ""https:'//'plivo.com/s3/img1.jpg""
                }
              ]
            },
            {
              ""type"": ""body"",
              ""parameters"": [
                {
                  ""type"": ""text"",
                  ""text"": ""ABM Water Purifier""
                }
              ]
            }
          ]
        }
client.messages.create(
    {
       src:"""",
       dst:"""",
       type:""whatsapp"",
       template:template,
       url: ""https:'//'.com/sms_status/""
     }
     ).then(function (response) {
       console.log(response);
      });
  

Customize the code with the following changes:

  • Replace the auth placeholders (such as <auth_id>) with your authentication credentials that can be found on the Plivo console
  • Replace the phone number placeholders with your phone number in E.164 format (for example, +12025551234). 
  • src should be the phone number registered for your WhatsApp Business Account.
  • dst should be the recipient's WhatsApp number.

Note that WhatsApp templates support four components: header, body, footer, and buttons. When you send messages, the template object you see in the code acts as a way to pass the dynamic parameters. header can accommodate text or media (images, videos, documents) content. body can accommodate text content. footer cannot have any dynamic variables.

That’s it - you’re all set to start using Plivo’s WhatsApp API. To learn more about Plivo’s WhatsApp API, please refer to our developer resources or reach out to our support team. 

The State of Marketing in 2024

HubSpot's Annual Inbound Marketing Trends Report

Frequently asked questions

No items found.
footer bg

Subscribe to Our Newsletter

Get monthly product and feature updates, the latest industry news, and more!

Thank you icon
Thank you!
Thank you for subscribing
Oops! Something went wrong while submitting the form.