Plug Samples #12: Verify Customer Mobile Numbers with OTP to Avoid Spam Entries

Plug Samples #12: Verify Customer Mobile Numbers with OTP to Avoid Spam Entries

Hi Everyone!

Verifying customer information is critical in business to filter out junk data and spammers. Whether it’s lead generation, appointment booking, or any other operation, ensuring quality data is essential for driving meaningful outcomes. A verified mobile number stands out as a dependable source of high-quality data. When automating processes with chatbots, you can enhance data quality by adding mobile number verification through OTP (One-Time Password)

We’ve developed a plug script that verifies customer mobile numbers using OTP (One-Time Password) integrated with Twilio. You can add this to your Codeless bot builder to make your bot smarter, your processes smoother, and your data more reliable.

Overview of verifying the mobile number with OTP:

We need two Plugs:
  • Plug 1 - Generate & send OTP to the mobile number:
  • Plug 2 - Verify the OTP 
Plug 1- Generate & send OTP to the mobile number:
  • Open SalesIQ, navigate to Settings > Developers > Plugs > Add.
  • Give a name, description for the plug. Select the Platform as Scripts, and click on Create Plug. 
  • The first step in building the plug is defining the parameters. Click on the parameters on top and declare the following. 
Input Parameter 
  • Name : phone | Type : Phone
Output Parameter 
  • Name : status | Type : String
  • Name : otp | Type : Number
Copy the code below and paste it into your plug builder. Then, make the following changes
  • In line #8, replace your account_sid (Navigate to the Twilio >  Select your account > Account info > copy the Account SID)
  • In line #12, the auth token (Navigate to the Twilio > Select your account > Account info > copy the Live/Test credential)
  • In line #19, replace your Twilio phone number. 
  1. response = Map();
  2. phone = session.get("phone").get("value").remove(" ");
  3. //Generate OTP
  4. otp = randomNumber(1000,9999);
  5. //Message body
  6. body = "Your OTP for Zylker is " + otp;
  7. //Navigate to your Twilio profile > Account > API Keys & Tokens > copy the Account SID 
  8. account_sid = "ACa988e5ee589d4c827439d1";
  9. url = "https://api.twilio.com/2010-04-01/Accounts/" + account_sid + "/Messages.json";
  10. //To get auth token, Navigate to your Twilio profile > Account > API Keys & Tokens > copy the Account SID and Auth token. 
  11. //auth = "<Account SID>:<Auth token>"
  12. auth = account_sid + ":e67e8be6805u8jc717cbd6a6a0";
  13. auth_encoded = zoho.encryption.base64Encode(auth);
  14. headers = Map();
  15. headers.put("Authorization","Basic " + auth_encoded);
  16. params = Map();
  17. params.put("To",phone);
  18. //Replace your Twilio number 
  19. params.put("From","+14173879299");
  20. params.put("Body",body);
  21. response = postUrl(url,params,headers);
  22. status = response.get("status");
  23. if(status == "delivery_unknown" || status == "undelivered" || status == "failed")
  24. {
  25. sms = "failed";
  26. }
  27. else
  28. {
  29. sms = "success";
  30. }
  31. info response;
  32. response.put("status",sms);
  33. response.put("otp",otp);
  34. return response;
Then, click Save, preview the plug, and Publish it.

Plug 2 - Verify the OTP 
  • Open SalesIQ, navigate to Settings > Developers > Plugs > Add.
  • Give a name, description for the plug. Select the Platform as Scripts, and click on Create Plug.
  • Click on parameters and declear the following.  


Input Parameter 
  • Name : systemotp | Type : Number
  • Name : visitorotp | Type : Number
Output Parameter 
  • Name : otpstatus | Type : String
Copy the code below and paste it into your plug builder
  1. response = Map();
  2. systemotp = session.get("systemotp").get("value");
  3. visitorotp = session.get("visitorotp").get("value");
  4. if(systemotp == visitorotp)
  5. {
  6. otp_status = "OTP verification successful";
  7. }
  8. response = Map();
  9. response.put("otpstatus",otp_status);
  10. return response;
Then, click Save, preview the plug and Publish it. 
NotesNote : Only published Plugs will be listed in Codeless Bot Builder. 

How to add Plugs to the Codeless bot builder?

Collect the Visitor's Phone Number
  • Use the Phone Card to get the visitor's phone number.

Generate and Send OTP
  • Configure Plug 1 to generate and send a unique OTP to the visitor:
  • Under Action Cards, select the Plugs Card and choose Plug 1.
  • Choose Phone as the input (context variable).
  • Get the OTP and its status as outputs, saving them in the bot context as system_otp and otp_status, respectively.
  • Click Save to store the configuration.

Check OTP Delivery Status
  • Add a Criteria Router Card to verify if the OTP was successfully sent:
  • In the Plug Success Flow, add a Criteria Router Card.
  • Create a rule: For a flow OTP sending failed flow by setting the context variable otp_status returning "failed" (OTP failed).
  • The Not Matched Flow represents successful OTP delivery to the visitor.

Handle OTP Input from Visitor
  • In the Not Matched Flow of the Criteria Router:
  • Use a Visitor Fields Card to collect the OTP entered by the visitor.
  • Save the visitor's input in a context variable (visitor_otp).

Verify OTP
  • Use Plug 2 to compare the generated OTP (system_otp) and the visitor-provided OTP (visitor_otp):
  • Provide both OTPs as inputs to Plug 2.
  • Assign a variable to save the verification result.

Next Steps Based on OTP Verification
  • If OTP verification succeeds: Proceed with the next flow.
  • If OTP verification fails: Prompt the visitor to re-enter the OTP and repeat the verification process using the button card.



    • Recent Topics

    • Copy, Duplicate, or Clone a Custom View?

      I searched the forums and didn't see anything on the subject. Is there a way to copy, duplicate or clone a custom view? I want a custom view similar to one I've already created. I just want the columns in different order.
    • Import from OneNote

      Is there a way to import notes from OneNote? 
    • In Zoho Forms - adding a Zoho CRM field for Contact barely shows any fields.

      I'm making a Zoho Form and I want to add a CRM field for Contact. I was expecting to be able to match the contact on the email address provided in the form. My standard layout has lots of fields but for some reason on the dropdown list in Zoho Forms,
    • Is Bigin Really Free - Confused by notifications?

      I started to look at Bigin as I was under the impression it was free, but as I started using it I kept getting messages that my trial period was X number of days and to upgrade. When I see something like this I assume I am not on a free version of anything
    • Tracking a loan from an investor - a new Bank or Credit Card

      I have an investor providing money from a HELOC (Home Equity Line Of Credit). I have also turned around and loaned this money to another company. But I want to track my outstanding balance of the debt that I owe to the HELOC. Would I / should I track
    • Introducing Zia LLM: Zoho’s in-house Generative AI solution for CRM's AI capabilities

      Hello everyone, We're excited to announce the launch of our in-house Large Language Model (LLM) by Zia to power our AI offerings. What is LLM? LLM stands for Large Language Model, a powerful AI technology that processes and generates human-like text based
    • The Zoho Meeting Video Quality Crisis

      I'm evaluating Zoho One for my business in Switzerland, and I must address a critical concern that threatens our potential adoption of the platform—the persistently poor performance of Zoho Meeting's video conferencing capabilities. In today's digital-first
    • Pay run Error

      Trying to run the last payroll of the year. The payment doesn't get to the employee Due to Technical Glitch in Tool, kindly Help us and resolve IT's showing Technical Glitch from Bank Website But bank People saying contact Zoho team for further solu
    • How to make the default currency type in a certain module different from the base currency>

      We have US dollar as the base currency. Also we have two more other currency types. In a custom module, we would like to make another currency as the default one rather than USD. Is it possible to do? How? Thank you very much!
    • Track Contact's Employment/Account History

      Thank you in advance for all of your help! Is there a way, within Zoho, to keep track of a contact's employment history? For example, if John Doe is my contact at Account 1, but leaves the company and is hired by Account 2, can I... ...maintain John Doe
    • CRM became very slow

      Plz check asap. image failed to upload , workflow doesn't run
    • ZohoCRM Workflows Not Triggering After Tool Recovery

      I noticed that ZohoCRM experienced an issue earlier, and according to the status webpage (https://status.zoho.com/), all tools were reported to be fully restored as of 03:00 (PST) on December 30, 2024. However, ZohoCRM workflows are still not triggering
    • API to post drafts for social media

      I we want to post draft posts to our zoho social account and then approve and schedule them within Zoho social. is this possible with for example: https://apis.zoho.com/social/v2/post TIA Jon
    • What do the color presents represent on the parts of the website?

      I would like to customize my color palette, but I have no idea how each color relates to the parts of the website. It is labeled as uno, duo, trio, etc... Could somehow tell me how they're related or name them more intuitively? Thanks
    • Switch to enable or disable sent notification when close a ticket

      Some time you need to turn off the notification email on closing a ticket. But the only way is in the Settings of Zoho Desk. It would be great to have a switch in the ticket just to disbale for once the notification mail when close the ticket.
    • Deluge upload to upload file field

      Trying to upload a file to a field type Upload File. I believe I have most correct. I have a merge and download from writer. I have this same script in many other functions and it works fine. I then upload the file to ZFS and get a success response However,
    • Alternatives to using multi-select lookup field for a 1-many module relationship?

      I have 2 modules where I only need multi-select lookup option on one of them and the other always has a 1-1 relationship. Do I have to use a multi-select lookup field in this case? Is there another way to solve this? Am asking because I've hit the limit
    • O que é o Code Studio no Zoho Analytics?

      Olá Pessoal, Colocando um pouco de informação sobre uma feature do Zoho Analytics chamada Code Studio. O Code Studio é: ‌Funcionalidade que permite desbloquear recursos de Data Science e Machine Learning (DSML) no Zoho Analytics. Utiliza código Python
    • Sobre qual tema você gostaria de falar em 2025?

      Olá Pessoal, Quais temas que gostariamos de explorar em 2025? - Zoho CRM Customizações Básicas - Zoho CRM Funções Personalizadas - Zoho Desk Básico - Zoho Desk Avançado - Zoho Analytics - Zoho Creator Deixe a sua opinião
    • Sobre qual tema você gostaria de falar em 2025?

      Olá Pessoal, Quais temas que gostariamos de explorar em 2025? - Zoho CRM Customizações Básicas - Zoho CRM Funções Personalizadas - Zoho Desk Básico - Zoho Desk Avançado - Zoho Analytics - Zoho Creator Deixe a sua opinião
    • Automatic Updates for Zoho Desk Extensions

      Dear Zoho Desk Team, I hope you're doing well. We would like to request the addition of an automatic update feature for Zoho Desk extensions. Currently, updating extensions requires manually searching for updates and clicking the update button. This process
    • Contemplating moving my site from WordPress to Zoho Sites

      Hi Everyone, We currently find ourselves in a situation where we ant to review and update our current sites content. We are small business owners, not developers. We currently use a wide range of Zoho products. We sometimes think about the possibility of either moving or just starting from scratch on Zoho Sites. I would like to know if anyone has done this and of course the things that need to be considered. We have spent quite a bit of time getting our current site positioned organically and I guess
    • How to view all departments on one dashboard or ticket view?

      Hi guys, We've just started using Zoho Support and found a very weird quirk. It seems that you need to click into each deparment to view the new tickets instead of just seeing a global dashboard of all tickets across all departments. Seems very odd, is this correct or are we missing something? If this is currently not possible, can someone from Zoho let us know if a global dashboard view is going to be developed soon? How soon? This is going to be a dealbreaker for us as we have lots of departments...
    • Is Drawing feature supported in zoho Sheets?

      Is there any option to draw arrows and some basic shapes such as circle , rectangle etc in zoho sheets? if so, can someone help me find it 
    • Is there a way to sync Tags between CRM and Campaigns/Marketing Hub?

      I wonder if there is a way to synch the tags between CRM and Marketing-Hub / Campaigns?
    • IP Addresses for Whitelist

      Hi,  Where can I get a list of the IP addresses I need to whitelist for accessing Zoho Desk? TIA
    • We would like to make a separate, internal-only knowledge base. Is it possible to have a public department but not display it in the help center?

      It seems like it is not possible to display/hide the knowledge base from the help center per department.  Is there a way to do this? It looks like all department knowledge bases are displayed if they are public, and there is no way to hide one from the help center while keeping it accessible via a permalink URL. For example, lets say I have one KB for Clients and one for Employees.    I want to keep my Clients KB public, and also want the Employees KB to be public, but NOT displayed in the help center.
    • Template Email Reset Password

      Hi It is possible to customize the email that comes to a Customer Portal user? It comes in English and need this in Spanish. Esteban Elias Preventa Tecnica - Educacion Xpears.com
    • URL_ROLLING_THROTTLES_LIMIT_EXCEEDED

      Hello, for several times now we are getting URL_ROLLING_THROTTLES_LIMIT_EXCEEDED in the Failure tab. What does it mean, and how can we solve this? Thanks, M.
    • Link Purchase Order to Deal

      Zoho Books directly syncs with contacts, vendors and products in Zoho CRM including field mapping. Is there any way to associate vendor purchase orders with deals, so that we can calculate our profit margin for each deal with connected sales invoices
    • Possible to customise list of file attachment options?

      Is it possible to customise (disable/remove) the list of file attachment options (see screenshot below)? I would like the users to only use the options "Link (URL)" and "Other Cloud Drives". I have super admin rights to customise the CRM.
    • Automating CRM backup storage?

      Hi there, We've recently set up automatic backups for our Zoho CRM account. We were hoping that the backup functionality would not require any manual work on our end, but it seems that we are always required to download the backups ourselves, store them,
    • Adding custom_field to the items when creating item groups

      I am migrating products from my existing db to zoho inventory. So when grouping the products and creating items with the groups, I want to store my old skus in custom_field to be able to trace back the products. Isn't it possible to add custom_fields
    • URL for downloading uploaded file - THE SOLUTION

      Hi, I would like to share the solution for downloading uploaded files using url. There is no documentation for it and there are multiple forum threads with old solutions that didn't work for me. Here is the updated url - tested and works! fet = form_name[ID
    • All Tasks Queued for Last 3+ Hours

      How does one resolve this? All of my tasks, from many different Flows, are stuck in the "Queued" status. This is interrupting my business processes, which depend on the timely execution of automations.
    • Why can't I connect to the software suddenly? Network error, internal error, unable to contact you

      Why can't I connect to the software suddenly? Network error, internal error, unable to contact you
    • Incorrect Closing Stock Amount value

      Act as Zoho Inventory Expert. We are a construction company, OVAL Projects Engineering Limited. We started using Zoho Inventory for Stock Management.I have multiple warehouses. I have encountered a problem while generating custom warehouse wise inventory
    • Auto Generated Invoice number YEAR

      Auto Generated Invoice number shows transaction year as 25 even though it's 24 still.
    • The Social Wall: December 2024

      Hey everyone, As the year comes to an end, and the festive spirit fills the air, we're thrilled to bring to you the final edition of the Social Wall for 2024. Let's see what updates went live during December, and then go on with planning the new year!
    • Not displaying a newly created window within an application

      On a specific stock trading application (see image below), when a newly created full screen operation is invoked (File->New) oft times it is invisible (the mouse input is correctly routed to the new window but the hover over contents shows the invisible
    • Next Page