InteGreat 06: Integrate your Zoho Creator app with Whatsapp using Twilio

InteGreat 06: Integrate your Zoho Creator app with Whatsapp using Twilio

Hi folks,

We're back with a new post in our InteGreat series, and this time we're going to walk you through how to integrate your Zoho Creator application with Whatsapp using Twilio.

Before we dive into this integration, let's quickly cover some basics.


What is Whatsapp? How do businesses leverage it?

WhatsApp Messenger, or simply WhatsApp, is a cross-platform messaging app that lets you make video and voice calls, send text messages, and more.

With the introduction of Whatsapp Business, more businesses are using it as a means to communicate and engage with their customers and leads. They also use it for sending information, such as appointment details, shipping details, and confirming booking requests.


What is Twilio?
Twilio is a communications platform that allows software engineers to build voice and SMS capabilities into applications. Many of our customers integrate their Zoho Creator apps with Twilio to send SMS notifications, such as appointment reminders, transaction details, status updates on orders, and device approvals.

In this post, we'll talk about how to integrate your Creator app with Whatsapp, to communicate relevant information to your customers. That is, whenever a user or a customer submits data in a form, we can trigger a notification to the user, sharing relevant information. We can automate this entire process using Twilio on Creator's form workflow option that's enabled using an API. 


Why use Twilio to integrate a Creator app with Whatsapp?

Whatsapp doesn't provide a direct, end-user API, however, they allow you to host a small service, which in turn talks to Whatsapp servers. But hosting your own server can be challenging in terms of reliability, security, and knowledge, so we're using the cloud-based service option.

Twilio is one of the established messaging service providers that we support integration for. So you can opt to use the Twilio API to act as host to communicate with Whatsapp.


Before we do that, though, we need to set a few things to configure the integration.


Step 1: Set up a Whatsapp Business account, set up your Facebook Business Manager account, and set up a Twilio account using the same Whatsapp Business account mobile number.

Step 2: After you create the Twilio account, request access to enable the Twilio number for Whatsapp messages, and verify your Facebook Business Manager account.

Step 3: Create an appointment/registration form in your Creator application to collect the mobile numbers and the consent for Whatsapp notifications. 

Now, let's go in-depth into each of these steps:


Step 1: Setting up the accounts

Whatsapp Business account: First, choose the mobile number from which the notification is to be triggered, and use that mobile number to set up Whatsapp Business account.

Facebook Business Manager account: Then, please do set up your Facebook profile to create a Business Manager account, if you already haven't set up one. You can use your Facebook username and password to sign in to Business Manager.

To create a Business Manager account:

  1. Go to business.facebook.com/overview.
  2. Click Create account.
  3. Enter a name for your business, your name, and work email address and click Next.
  4. Enter your business details and click Submit.

Twilio account: Next, do sign up for a Twilio account with the same mobile number with which you've set up the Whatsapp Business account.

Once these initial setups are configured, you can proceed to request access and verification.

Step 2: Request access and verification

Now, WhatsApp uses your Facebook Business Manager account to identify your business and associate your phone number with it.

Twilio provides a sandbox environment, where users can test the API code with a sandbox from the number provided by Twilio, which can used used to test the API. To use your own number for notifications, you need to submit a request to Whatsapp with your business requirement. They need to approve it to trigger Whatsapp messages via the API. Whatsapp doesn't provide a direct, end-user API URL, so we're integrating it on top of the Twilio API and using that in the Creator application.

Please note that WhatsApp has final discretion to approve companies to use the API. You can follow the steps given below to request access and complete the verification process:

1) Twilio: Request access to enable your Twilio numbers for WhatsApp.
2) Twilio: Submit a sender profile and message templates.
3) Facebook: Approve Twilio to send messages on your behalf.
4) Facebook: Verify your Facebook Business Manager account.
5) Twilio: Twilio completes your WhatsApp sender registration.


Step 3: Configuring the code

Once you've completed the verification process and set the Whatsapp account, you can make use of the Twilio API on a Zoho Creator workflow to trigger a Whatsapp message.

For that, let's create a simple appointment or registration form in your Creator app.

Along with the other fields, you need to add the following fields:

  • Phone number type field to collect the mobile number of the customer/user
  • Decision box type field to get consent for Whatsapp notification



Once you've created the form, on On create on success, you need to add the code to trigger the Whatsapp notification based on the value in the Decision box field to send notifications.

Please find the below sample code added with the post URL call to trigger the notification via the Twilio API.

  1. if(input.I_agree_to_receive_whatsapp_notification == true)
  2. {
  3. mp = Map();
  4. mp.put("To","whatsapp:" + input.Mobile_Number);
  5. mp.put("From","whatsapp:+91**********");
  6. mp.put("Body","Your appointment is coming up on" + input.Appointment_Date_Time.todate());
  7. header = Map();
  8. username = zoho.encryption.base64Encode("<TWILIO_ACCOUNT_SID>:<TWILIO_AUTH_TOKEN>");
  9. header.put("Authorization","Basic " + username);
  10. resp = postUrl("https://api.twilio.com/2010-04-01/Accounts/<TWILIO_ACCOUNT_SID>/Messages.json",mp,header);
  11. info resp;
  12. }

Script explanation:

  1. Here, "I_agree_to_receive_whatsapp_notification" is the Decision box field, and we are using the if condition to trigger notifications only to the user who checked this field while submitting data in the form.

  2. Mobile_Number is the phone number field where the user enters their mobile number while submitting the form.

  3. The From in the code part is a static phone number from which the notification will be sent to all users for which the above setup and verifications were done. The business name and the logo as submitted in step 2 for "Submit a sender profile and message template" will reflect on the from part of the Whatsapp message to the customers.

  4. The Body part is the content of the Whatsapp message, where you can have both the static and form field content passed against it. 

  5. The "To" number (dynamic content) and the "body" of the Whatsapp message are the content filled in on the Creator form, and need to be passed to a data map.

  6. Authenticate the API on the Creator end with basic authentication, as below.
    username = zoho.encryption.base64Encode("<TWILIO_ACCOUNT_SID>:<TWILIO_AUTH_TOKEN>");
    header.put("Authorization","Basic " + username);
     

    The account SID (string identifier) and Authtoken will be available in the settings option under Twilio account, as in the screenshot given above.

    Note: A string identifier (SID) is a unique key that's used to identify specific resources. Here, the account SID is used to identify the Twilio account from which the API is triggered.

  7. Construct the Twilio Whatsapp API call in the below format:

    postUrl("https://api.twilio.com/2010-04-01/Accounts/<TWILIO_ACCOUNT_SID>/Messages.json",mp,header);

    Here, both the header map (header) and the data map (mp) are passed as arguments for the POST URL call to authenticate and trigger the Whatsapp message via API. 



    8. Please don't forget that WhatsApp requires that your application implement explicit user opt-ins to deliver messages over WhatsApp on the mobile number provided, while submitting the data on the Creator form and triggering the notification only for consenting users. Whatsapp also recommends that business owners track and save these details for future reference.

    Please note that sending messages to end users without an opt-in may result in users blocking your business, as well as the suspension of your WhatsApp Business account.
We hope this tip was useful to you! If there are any questions, feel free to ask in the comments below, and we'll be happy to address them for you!

    Access your files securely from anywhere

          Zoho Developer Community




                                    Zoho Desk Resources

                                    • Desk Community Learning Series


                                    • Digest


                                    • Functions


                                    • Meetups


                                    • Kbase


                                    • Resources


                                    • Glossary


                                    • Desk Marketplace


                                    • MVP Corner


                                    • Word of the Day



                                        Zoho Marketing Automation


                                                Manage your brands on social media



                                                      Zoho TeamInbox Resources

                                                        Zoho DataPrep Resources



                                                          Zoho CRM Plus Resources

                                                            Zoho Books Resources


                                                              Zoho Subscriptions Resources

                                                                Zoho Projects Resources


                                                                  Zoho Sprints Resources


                                                                    Qntrl Resources


                                                                      Zoho Creator Resources



                                                                          Zoho Campaigns Resources


                                                                            Zoho CRM Resources

                                                                            • CRM Community Learning Series

                                                                              CRM Community Learning Series


                                                                            • Kaizen

                                                                              Kaizen

                                                                            • Functions

                                                                              Functions

                                                                            • Meetups

                                                                              Meetups

                                                                            • Kbase

                                                                              Kbase

                                                                            • Resources

                                                                              Resources

                                                                            • Digest

                                                                              Digest

                                                                            • CRM Marketplace

                                                                              CRM Marketplace

                                                                            • MVP Corner

                                                                              MVP Corner





                                                                                Design. Discuss. Deliver.

                                                                                Create visually engaging stories with Zoho Show.

                                                                                Get Started Now


                                                                                  Zoho Show Resources


                                                                                    Zoho Writer Writer

                                                                                    Get Started. Write Away!

                                                                                    Writer is a powerful online word processor, designed for collaborative work.

                                                                                      Zoho CRM コンテンツ






                                                                                        Nederlandse Hulpbronnen


                                                                                            ご検討中の方





                                                                                                  • Recent Topics

                                                                                                  • Custom Deal Name in Lead Conversion Mapping

                                                                                                    I know there are ways to change the name of a Deal after conversion using a custom function, so no need to repost that information. I would like to see the CRM Improved with Deal Name Customisation and I think the Lead Conversion Mapping page would be
                                                                                                  • Build custom AI solutions with Catalyst’s QuickML capabilities in CRM

                                                                                                    Hello everyone, We’re thrilled to announce an improvement for our Zoho CRM Enterprise users: the ability to create custom AI solutions using Catalyst’s QuickML directly from Zoho CRM. As you may already know, Zia, Zoho CRM’s AI-powered assistant, offers
                                                                                                  • Recommendations to store meeting notes for easy access from Contacts, Accounts & Deals module records?

                                                                                                    I would like your advice on how to achieve this use case for my organization. It’s related to where/how best to store meeting notes from a conversation with Contact(s) working at an Account (Company) in the context of a Deal. The ideal solution (from
                                                                                                  • Introducing Record Summary: smarter insights at your fingertips

                                                                                                    Hello everyone, Building on the recent launch of Zoho's in-house Zia Large Language Model (Zia LLM)—a major milestone in Zoho CRM’s AI capabilities—we’re excited to introduce the Record Summary feature. This powerful addition makes use of Zia LLM to simplify
                                                                                                  • Suppress "spreadsheet will not be saved" message on published sheet

                                                                                                    I have published a sheet and have one column on that sheet that the user can edit (a dropdown picklist where the user can select the status for each line). Is there a way to suppress the Zoho Sheet message "Any changes made to this published spreadsheet
                                                                                                  • Missing "Email Authentication" tab

                                                                                                    Backstage is alerting users about "Unauthenticated Domains" with a large prompt in the backend. It adds a link to learn more. On this tutorial page, it shows where to find the "Email Authentication" tab in this screenshot. However, in our Backstage, that
                                                                                                  • Blueprint - 'On hold' state with an automatic transition?

                                                                                                    I think I'm missing something here so I'm hoping if I explain what I'm trying to achieve someone might be able to give me a way around it. We sometimes get request far in advance but we don't want to action them unless it is 7 days from when they are
                                                                                                  • Show item Cost value on Item screen

                                                                                                    The Item screen shows Accounting Stock and Physical Stock. It would be very helpful if value information could be displayed here as well, for instance Cost Price. Currently, to find the Cost Price (as used for inventory valuations) from inside the item
                                                                                                  • Feature Request: Search in the PC client. Some thoughts about the search.

                                                                                                    Hi all. I'm really excited to start using Zoho Notebook, but I'm missing some of the search capabilities on my desktop. There are also some thoughts on improving search in general. Search is very important to me, without it it is difficult for me to use
                                                                                                  • Gravity Forms plugin not passing some fields

                                                                                                    I use the gravity form zoho plugin to push data from my lead form into my lead page in Zoho CRM. Everything was working file for about 6 months. Suddenly on Oct 1st, some of the fields are no longer getting passed to Zoho. The fields with the problem
                                                                                                  • Zoho Analytics to Zoho Sheets - automatic update?

                                                                                                    Hi all, If I create a zoho sheet from an Analytics Report or Analytics Data, is there a way for the zoho sheet to automatically update as the Report / Data in analytics updates?
                                                                                                  • Phone App of CRM doesn't find contacts

                                                                                                    I open the crm to and do a contact search but nothing comes up. If I do a full zia search it will find an old note that is attached to a contact and I can open the contact. BUT I still can't enter notes of calls, set appointments, etc. It requests I go
                                                                                                  • Integration with Moodle

                                                                                                    Greetings, I hope find all doing well and safe. I've recently returned to using Zoho Flow after a break and was hoping to connect my WooCommerce store with Moodle, the world's most widely used learning management system. My goal was to automatically enroll
                                                                                                  • Task status - completed - other options

                                                                                                    I have a dumb question I know i can make custom statuses for the tasks - but is there anyway to make additional "completed" statuses like for instance if i have a task "call back customer" and i leave a vm for them to call back marking it "completed -
                                                                                                  • Task module and related-to field

                                                                                                    In modules other than the Task Module I can add several lookup fields to provide a variety of relationships. In the Task module lookup fields are not available. There is only one "related to" field which I want to use for Company. But I want to relate
                                                                                                  • Zoho Assist "Agree and Download" Button "Greyed Out" ("Light Blued" Out)

                                                                                                    Anyone else having issue where support clients are unable to click "Agree and Download" to access the client so that we can provide remote support? This is for "on demand" support via accessing the support page and entering the support key and name. This
                                                                                                  • Add Lookup Field in Tasks Module

                                                                                                    Hello, I have a need to add a Lookup field in addition to the ones that are already there in the Tasks module. I've seen this thread and so understand that the reason lookup fields may not be part of it is that there are already links to the tables (https://help.zoho.com/portal/en/community/topic/custom-fields-on-task-module).
                                                                                                  • migrating from Zoho Invoices (CRM) to Zoho Books

                                                                                                    Good day, I was wondering if there was a easy way to migrate all the quotes and invoices from Zoho Invoices CRM to Zoho Books. We plan to move to using Zoho Books in a few weeks and would like to have all the quotes and invoices from the past 3 years
                                                                                                  • Zoho MA and Custom Module

                                                                                                    I am trying to create a sync between Markting Automation and Zoho CRM. I am mapping a custom module from the CRM. The custom module has email field mobile phone field However I cannot finish the integration since the system keeps asking me for email or
                                                                                                  • When is partial reimbursement going to be launched?

                                                                                                    Hi there. I saw somewhere that the partial reimbursement feature is in the work. What is the update and ETA of that? Our clients and prospects have been asking us and we agree that that is an important feature to have.
                                                                                                  • All notes disappeared

                                                                                                    I've been using the notebook app for over five years on my phone without being logged into an account. A few days ago I opened the app and all my notes had disappeared. Since then I tried restarting my phone, updating the app and logging into my account,
                                                                                                  • Introducing Keyboard Shortcuts for Zoho CRM

                                                                                                    Dear Customers, We're happy to introduce keyboard shortcuts for Zoho CRM features! Until now, you might have been navigating to modules manually using the mouse, and at times, it could be tedious, especially when you had to search for specific modules
                                                                                                  • Is there any support for Drivers license and other forms of ID scanning capabilities?

                                                                                                    When scanning a drivers license barcode for data input to a Form, the scanning tool receives all the raw data but there doesnt seem to be a function to limit or remove the unnecessary fragmrnts, like a prefix. Is there any support or info in the help
                                                                                                  • Year-End Wrap: Declutter Your Inbox Using Email Filters

                                                                                                    Ping!—an email drops in. And another. And another! It's finally that time of the year when your inbox will be bursting with messages from team members, clients, and marketing agents, leaving you feeling overwhelmed and distracted. Sounds familiar? Now
                                                                                                  • Unified Notes View For Seamless Collaboration

                                                                                                    To facilitate better coordination among different departments and team members, the notes added to a record can now be accessed in all its associated records. With this, team members, from customer service representatives to field technicians, can easily
                                                                                                  • Q4 Europe In-person Zoho User Group Meetup: Streamlining Your Business Processes & Introduction to Zoho CRM for Everyone

                                                                                                    Hello Zoho Community, We are excited to announce our upcoming Zoho User Group meetup in Europe! This session is designed to help you streamline your business processes using Zoho CRM, with a special focus on enhancing customer interactions and leveraging
                                                                                                  • Formula fields - Request for dynamic recalculation / proper implementation

                                                                                                    Hi Guys, I have a big problem with Zoho formula fields. They don't recalculate each time the record is viewed - only when a record is edited. Formula fields should be updated dynamically each time a record is retrieved. As an example: I have a formula
                                                                                                  • Items attribute questions

                                                                                                    Many of my items have attributes, such as size and color. How can I add new fields to the "New Items" screen to capture that in my Purchase Orders, Items, and Sales Order pages? I only see these attribute fields when adding an Item Group. Also, on the
                                                                                                  • What do the Image Sizes mean in Zoho CRM Email Templates?

                                                                                                    Below you can see the image options in email templates: Banner, Fit, Small, Medium, Original, Custom. Can someone from Zoho please share with me: What each is/means? How each will look on desktop AND mobile? How to edit "custom"?  If I choose "Custom"
                                                                                                  • Workflows for Timesheet

                                                                                                    Good day, Any way to have timesheet as triggers? I looked into Zoho Flow and into Zoho Project automation but no where can I have timesheet as a trigger. Basically, I would like to trigger something upon timesheet approval. Right now, the only way to
                                                                                                  • Organize and Track Phases with Phase Custom Views

                                                                                                    Phase Custom Views let you filter and display phases based on specific criteria. This helps you focus on what’s most relevant for you and your team. Filter phases using criteria such as budget, status, and more. Share views with specific users or teams
                                                                                                  • Record Asset Received as Payment

                                                                                                    How exactly would you account for this in books? For example, I receive a mini computer for a review and I get to keep it after the video is published. Would debit my normal asset account (e.g. Computers) and credit an income account (e.g. Other Income).
                                                                                                  • Transform Your Customer Support with AI-Powered Chatbots in Zoho SalesIQ

                                                                                                    Ever wondered how some companies seem to have superhuman customer support? Let's uncover their secret! In the digital age, customer expectations are skyrocketing. Did you know that according to McKinsey, 75% of consumers expect a response within five
                                                                                                  • Unused items should not count into the available number of custom fields

                                                                                                    Hey, I realized that unused Items reduce the number of available custom fields. I can't see a case where that makes sense. Especially in our case where we have two different layouts in Deals with a lot of different fields, this causes problems.
                                                                                                  • Translate any published presentation to the language of your choice

                                                                                                    As part of our constant effort to enrich your presentation experience, Zoho Show has rolled out a new feature for translating published presentations. Consider the following scenario: Zylker IT services, a multinational corporation, has announced product
                                                                                                  • Power of Automation :: Automatically start / pause / stop timer on task status update.

                                                                                                    Hello Everyone, A Custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it. Requirement:-
                                                                                                  • Progressive Invoicing

                                                                                                    Progressing invoicing is needed for many industries. It would be great to see it implemented into Zoho Books as well. Set up and send progress invoices in QuickBooks Desktop (intuit.com)
                                                                                                  • Client Script - mapping data from different module

                                                                                                    Dear ZOHO Team Firstly I need to describe the need - I need to have data from Contacts module based on lookup field - the 5 map limit is not enough for me because I have almost 20 fields to copy So I have decided to make a Customer Script - and from unknown
                                                                                                  • Using Queries with dynamic parameters in Kiosk Studio

                                                                                                    Hi, I'm pretty new when it comes to developing within Zoho (I'm really a .NET developer), as it was just added to my responsibilities. For a new feature in the CRM, I'm trying to develop a Kiosk function to show a list of records (retrieved by the new
                                                                                                  • DORA compliance

                                                                                                    For DORA (Digital Operational Resilience Act) compliance, I’ll want to check if Zoho provides specific features or policies aligned with DORA requirements, particularly for managing ICT risk, incident reporting, and ensuring operational resilience in
                                                                                                  • Next Page