Integrate Sendwo with your website or app using the new Sendwo API. This allows you to send WhatsApp messages, including OTPs, directly from your platform. This article provides a step-by-step guide on sending WhatsApp OTP messages via the API.
To get your API key, go to the Sendwo dashboard, click on your user account, and select "API Developer." Then, click the "Generate API Key" button.
User Account > API Developer > Generate API Key

WhatsApp offers two APIs: the Send API and the Subscriber/Contact API. This example demonstrates sending a WhatsApp message using the Send API, specifically using a PHP script to deliver an OTP.
For business-initiated messages or messages sent outside the 24-hour customer service window, a pre-approved message template is required. While direct messaging is possible with users active in a 24-hour chat window, template messages can be sent to any user, even those added manually as subscribers.
To create a message template, go to your WhatsApp account's Message Template section within the WhatsApp Bot Manager.
WhatsApp > Bot Manager > Select Bot Account > Message Template
We'll start by creating a variable for our message template. This is necessary because each user will receive a unique OTP. To create the variable, click the "Create" button in the Template variables section.

Give a name for the variable and click on the save button. Now, from the message template settings click on the “Create” button to create a template.

Once the previous step is finished, a template creation form will appear. Provide a name and locale for the template. Select the appropriate category, and since this is an OTP template, choose "OTP" as the type. Adding a header is optional; if desired, select the "Header" type.
Compose the message in the body, including the generated OTP variable by selecting it from the provided list. A footer is also optional. Since this template doesn't require buttons, leave the footer setting as "None." Finally, click the "Save" button.

The template should be in the list after it has been created.

Click the check status button to discover if the template has been approved or not. They must immediately approve or disapprove.

Yes, the template was created and approved successfully.
To generate an API endpoint for sending a template message, navigate to "Generate API End-point : Send Template Message (GET)". Select the desired WhatsApp account (using your WhatsApp phone number) and choose the "OTP message template" from the available templates. This will use the template you recently created.

As soon we select the Message template it will ask us to put a name for it. Just put OTP on the field and click on the “Get API end-point”.

It will generate the API End-point. We will use this code in the PHP script to send OTP messages to WhatsApp users.

In the PHP script, we will put this generated code into a variable. Then we need to write a few lines of code.
$url="https://sendwo.com/api/v1/whatsapp/send/template?apiToken=1|bF90hdFU4Mm2uFxIFDbvvEIcxYqweyJuwrO25yEM&phoneNumberID=100761702762631&botTemplateID=712&templateVariable-OTP-1=OTP-VALUE&sendToPhoneNumber=SEND-TO-PHONE-NUMBER";
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
echo $response=curl_exec($ch);
?>
We need to change the OPT-VALUE and SEND-TO-PHONE-NUMBER from the API end-point to variables. Just like below.

The final code will look like this after updating the values with variables.
$otp= random_int(10000, 99999); $send_number="8801722977459";
$url="https://sendwo.com/api/v1/whatsapp/send/template?apiToken=1|bF90hdFU4Mm2uFxIFDbvvEIcxYqweyJuwrO25yEM&phoneNumberID=100761702762631&botTemplateID=712&templateVariable-OTP-1={$otp}&sendToPhoneNumber={$send_number}"; $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); echo $response=curl_exec($ch);
?>
[ Use must use your generated API End-point ]
If we just run this code, the message should be delivered to the WhatsApp number.
So, this is how we can utilize the WhatsApp API of Sendwo to deliver OTP messages to WhatsApp numbers.
Sendwo empowers you to expand your chatbot's capabilities by seamlessly integrating external APIs within the Flow Builder. This powerful feature bridges the gap between Sendwo and other platforms, enabling you to perform a wide range of actions, including data retrieval, form submissions, and user updates.
Sendwo's robust HTTP API integration ensures compatibility with a variety of external platforms, such as WooCommerce and WordPress, streamlining your chatbot's interactions and enhancing its overall functionality. Whether you want to display WooCommerce products in WhatsApp or integrate WordPress posts with WhatsApp, we've got you covered with step-by-step guides:
How to Display WooCommerce Products Inside WhatsApp
How to Display Dynamic List in WhatsApp Interactive Message
To create a new WhatsApp HTTP API connection in Sendwo:
In this section, you will configure the API settings to connect with external services:
https://example.com/api/v1/users/create).In this section, you need to define any required HTTP headers needed to make the API request:
application/json or another content type, depending on the API specifications.Authorization: Bearer
If the API request requires data to be sent in the body (for POST/PUT requests), configure the fields here:
username, first_name, last_name, and email.
Once you have entered all the required fields:
After a successful API connection, you can map the response data back into your workflow:
user_id or email, you can map this back to the subscriber’s profile in Sendwo.
Once your API is integrated and the response mapping is set up, you can now use this API connection within your Flow Builder to trigger API calls at different points in your chatbot’s conversation flow.

Seamlessly integrate external APIs into your Sendwo workflows. This empowers you to automate actions like user creation, subscriber data retrieval, and real-time updates to external systems directly within your Sendwo chatbot flows.
For in-depth guidance on connecting APIs, advanced settings, and troubleshooting, please reach out to our support team or explore our comprehensive help center resources.
Businesses seeking to engage customers beyond the immediate 24-hour window can significantly benefit from WhatsApp message templates. In this article, we'll guide you through the seamless creation of WhatsApp message templates directly within Sendwo, streamlining your messaging strategy.
Templates empower businesses with the ability to craft rich, structured messages incorporating media, making them invaluable tools for effectively delivering announcements, confirmations, and reminders.
Why Templates Matter:
Introducing Carousel Templates:
Leverage the WhatsApp Cloud API:
Creating Message Templates in Sendwo
1. Accessing Message Template Creation:
2. Creating Variables (Optional):
3. Creating a Message Template:
{{variable_name}}).Congratulations! Your message template has been successfully created.
To use this template for broadcasting, live chat, or integrated platforms like Shopify and WooCommerce, it must first be approved.
Once approved, you can seamlessly integrate this template into your communication workflows.
For a step-by-step guide on creating message templates for WhatsApp, please refer to our video tutorial.
WhatsApp has become indispensable for businesses seeking to cultivate strong customer relationships. Leveraging WhatsApp's Cloud API empowers businesses to effectively manage customer interactions through pre-defined message templates. These structured messages can be sent at any time, circumventing the 24-hour interaction window limitation.
This article will guide you through creating a WhatsApp message template within WhatsApp Manager and subsequently syncing it with Sendwo. This integration will enhance your customer outreach by enabling automated, personalized messaging. For creating templates directly within Sendwo, please refer to our detailed guide: How to Create A Message Template for WhatsApp in Sendwo Dashboard.
WhatsApp also supports carousel templates for message delivery. While carousel templates are currently unavailable within WhatsApp Manager itself, Sendwo offers robust support for creating and sending these engaging message formats. Explore our guide on 'How to Create WhatsApp Carousel Templates with Sendwo" for detailed instructions.
To create a message template for WhatsApp, start by logging in to business.facebook.com. If you manage multiple businesses, choose the appropriate one from the dropdown menu. Then, navigate to the "All Tools" menu and select "WhatsApp Manager."

Click the three dots menu and select 'Manage Message Templates'.

To create a WhatsApp message template:

Let's create a WhatsApp message template with a visually appealing header. You can choose a text header or a media header (image, video, or document). For this example, we'll use an image header.
Next, compose the main body of your message. You can personalize it by using variables to dynamically insert information. Optionally, include a footer for additional context.
To enhance user interaction, let's add quick reply buttons to your template. This allows recipients to easily respond with specific options.
Before submitting your template for approval, we need to provide sample data. This includes examples for the header and any variables used in the message body.
Once you've added the sample data, you can submit your template for review.

WhatsApp will verify the template and approve it, after which it can be used.
Next, we'll integrate our message template with Sendwo.

After mapping the variables, we can save the message template. Now, the message template is ready to be used by the Sendwo chatbot.
In summary, integrating WhatsApp Cloud API message templates with Sendwo is a relatively simple process. By adhering to the steps detailed in this guide, businesses can effectively leverage these templates to enhance customer communication. This approach can also contribute to faster response times and increased customer engagement.
To modify an existing WhatsApp template, begin by making the necessary changes within your WhatsApp Business Manager. Subsequently, unlink the existing template integration in Sendwo. Finally, proceed to sync the updated template and remap it within the Sendwo platform as outlined earlier.
Broadcasting WhatsApp messages is a cornerstone of Sendwo's functionality. Previously, importing contact lists was limited to CSV files. However, Sendwo now offers enhanced flexibility by allowing you to import WhatsApp contacts directly from Google Sheets.
This guide will walk you through the process of importing subscribers or contacts from your Google Sheet to Sendwo. The first step involves connecting the Google account containing your WhatsApp contact data. Follow these steps to establish the connection.

You can either create a sheet from Sendwo itself or import an existing Google Sheets from your account. We will go over both methods.
Once the sheets are created, click on the 'view' button to add your contacts.
To connect your Google Sheet, simply click "Add Existing Sheet." Select the desired Google account and then paste the Sheet ID into the provided field. You can easily find the Sheet ID from the sheet's URL.
Once created or added, your connected sheets will appear in a list and can be readily used for importing contacts.

To import your WhatsApp subscribers from Google Sheets to Sendwo, follow these simple steps within the WhatsApp Subscriber Manager:

This completes the process. The contacts from the Google Sheet will be imported into your Sendwo WhatsApp subscriber list.