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

    • How to Retrieve and Store Expense Attachments from Zoho Expenses?

      I am currently syncing Zoho Expenses with our internal portal. During the sync process, I can successfully retrieve expense details, including document-related information such as file_name, document_id, and other metadata. My goal is to retrieve these
    • Introducing Formula Fields for performing dynamic calculations

      Greetings, With the Formula Field, you can generate numerical calculations using provided functions and available fields, enabling you to derive dynamic data. You can utilize mathematical formulas to populate results based on the provided inputs. This
    • 5名限定 課題解決型ワークショップイベント Zoho ワークアウト開催のお知らせ (12/19)

      ユーザーの皆さま、こんにちは。Zoho ユーザーコミュニティチームの藤澤です。 12月開催のZoho ワークアウトについてお知らせします。 ※定員に達したため、受付を終了しました。 ━━━━━━━━━━━━━━━━━━━━━━━━ Zoho ワークアウトとは? Zoho ユーザー同士で交流しながら、サービスに関する疑問や不明点の解消を目的とした「Zoho ワークアウト」を開催します。 Zoho サービスで完了させたい設定やカスタマイズ、環境の整備など……各自で決めた目標達成に向け、 他の参加者と同じ空間で作業を行うイベントです。先輩ユーザーや他の参加者と意見交換をしながら集中して作業に取り組むことが可能です。
    • Does an email preview pane view register as opened?

      Hi, If a recipient of one of my campaigns views it in a preview pane, opposed to opening the email, does Zoho Campaigns register that email as being opened (viewed)?
    • Portal orders

      Is it possible to set up an ordering system through the portal so that my customers can place orders through their portal?
    • CLIENT PORTAL (If clients can place orders directly on the portal)

      Zoho client portal is excellent. Everything is there except one thing. Client should be able to place orders directly on the portal. This would enhance the portal and end users will be extremely happy. This suggestion infact came from one of our client.
    • Macro Email to be determined by a ticket field

      Hi, we are a commercial energy brokerage and are implementing Desk as our helpdesk tool to replace manual emails, personal whataspp and telephone. We have setup a macro rule when we can trigger an email, update ticket status and trigger a task.... but
    • Welcome Link Expired

      Hi The links sent to the users didn't get clicked on in time and now all the links have expired. Is there a way to send a new link without deleting them and re-adding them>
    • Zoho expense linked with Campaign instead of customers

      Hi, Is there a development planned for linked an expense or a report to a zoho campaign? Indeed, suppose I created a campain in which I add different clients (for example a trip to a foreign country where I meet 3 different clients), I would like this campaign to be linked to the expenses I have. Say I have a plane ticket, taxis and 1 hotel night, I would like those expenses to be linked to the 3 clients. With Zoho expense, it is not possible at the time (or maybe it is but I do not know how!). thanks
    • 🎄 Jingle, Mingle, and Automate: Spread Christmas Cheer with Zoho Desk Auto-Replies! 🎄

      Hello Everyone! Welcome to this week's episode of the Community Learning Series. Christmas is in the air, and I’m sure we can all feel the jingle and the mingle of the season! The folks at Zylker Techfix are no exception—they’re busy with holiday plans
    • Adjusting Physical Inventory

      Not getting very far with support on this one, they say they are going to fix it but nothings happened since November. Please give this a thumbs up if you would like to see this feature or comment if you have some insight. Use Case: Inventory set to be
    • Print PO receipt

      Hi I would like to print the PO receipt. There does not seem to be any way to do this. I track batch numbers and printing the PO does not show this. Only the receipt would show the details of the receipt. Currently I print the screen which does not have
    • Create a purchase order in vendor's currency

      I am having a problem working this out and would appreciate some suggestions. We have Books and Inventory working in tandem. We are in Australia, our product is sold in Australia in $A and obviously all our invoices, accounts and reports need to be in
    • Work Orders / Bundle Requests

      Zoho Inventory needs a work order / bundle request system. This record would be analogous to a purchase order in the purchasing workflow or a sales order in the sales cycle. It would be non-journaling, but it would reserve the appropriate inventory of
    • Getting error during inserting a record in form of zoho people using zoho api

      import requests import json # Set your access token and Zoho People API base URL access_token = '1000.XXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX' api_base_url = 'https://people.zoho.in/people/api/' # Set the form name and data to be inserted form_link_name
    • Change script to add fields

      Hi, I have a custom function (writen by a different implementation company in the beginning) which I would like to edit to add a different field as well. Can't get it to work on my own though. - The script now adds the address fields to a new quote (needs
    • 1 API to all channel

      hi zoho team: I am the product manager of anywheel, we are planning to integrate zoho, we want to integrate multiple channels through 1 API, please can you send me the integration document and guideline?
    • Revamped Print in Zoho Sheet—customized for paper

      The latest enhancements to Zoho Sheet's Print settings allows you to print a worksheet or a selected range, with customizations that make the data comprehensible, even on paper.   Customize header and footer Make your spreadsheets meaningful with a relevant header and footer. You can now choose to display the file name, sheet name, current page number, total pages, date, and time as the header and footer in your print view. Besides the predefined elements, you can also give a custom text for header/footer.
    • Adding Bluesky channel

      Hello, Is Bluesky (AT protocol) soon added on Social ? Bluesky is being developped and is now open to anyone (no more invitation) Thank you
    • How Can i put a form in Zobot

      Hi,how can i integrate a form which has a multiple options to choose from.the form should be opened or displayed by zobot after it meets a requirement in the conversation. Thanks in advance !
    • Unified customer portal login

      As I'm a Zoho One subscriber I can provide my customers with portal access to many of the Zoho apps. However, the customer must have a separate login for each app, which may be difficult for them to manage and frustrating as all they understand is that
    • message on click of button

      Hi, i added insert task on 'Quick view' below  'Action'  of report just below 'Delete' button,  so i am trying to add a message on click of button that, "This item is now added into Pending Request" like this .... So, how can i achieve this ; because
    • Is it possible to disable Chat Waiting Time, or to make it indefinite?

      We have used many online chat services over the years. However, Zoho's SalesIQ appears to be the only one we've tried that has a mandatory time limit where we must respond to new customer queries. We are a small business so we have no dedicated staff
    • 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 
    • Access CRM Variables from Formula field

      Is it possible to use a CRM variable (defined in Developer Space -> CRM Variables) in a formula field for calculations ?
    • Client Script: $Client.refresh({ triggerOnLoad: true }); not triggering onLoad Client Scripts

      Hey friends! I'm trying to store a temporary var, refresh the page for the user, then check that temporary var and do some actions. Theoretically using the title's code: $Client.refresh({ triggerOnLoad: true }); should refresh the page and trigger on
    • Super Admin login to delete certain folders and passwords and clearing the trash folder, they are still appearing on my dashboard

      Hi Zoho Team, I need help with an issue I've encountered. Despite using the Super Admin login to delete certain folders and passwords and clearing the trash folder, they are still appearing on my dashboard. I would like to understand why this is happening
    • Pulling Specific Products from Sales Orders in Books to a CRM Record

      We currently process orders directly through our website (woocommerce) as well as through manual sales orders in zoho books. When an order comes through the website, all of the individual products from that order show up in the CRM record of that customer.
    • Automatically add a retainer to every estimate

      Hi all, I've been trying to find a way to automatically add a retainer at a set % to every estimate we create and send. So far I haven't been successful, does anyone know of a way to do this? Thanks,
    • Clear String field based on the value of other field

      Hello everyone, We would like to be able to clear a string field (delete whatever has been written and make it empty) when another field (picklist) is changed to a specific value. While I can empty other types of fields, I noticed that I can't do this
    • 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
    • Within the Basic KPI component in Analytics, it is impossible to set "next" day range as a filter

      Hi there, I am currently setting up a deal dashboard for the Sales team. While it is possible to filter deal records to show records that were created LAST X days only, it looks like a NEXT X days Closing date filter is not available. Would it be possible
    • Invoice status on write-off is "Paid" - how do I change this to "Written off"

      HI guys, I want to write off a couple of outstanding invoices, but when I do this, the status of the invoices shows as "Paid". Clearly this is not the case and I need to be able to see that they are written off in the customer's history. Is there a way
    • For each loop with available time slots

      I am very new to Deluge, and this question was unable to be answered by Zoho Creator tech support upon request. Task at hand: I have a Form with 4 fields: - Date Start - Date End - Dropdown: Time Start: contains time slots (12:00PM, 12:15PM, etc) - Dropdown:
    • Can we have Backorder Management ?

      Can we have Backorder Management ?
    • Converting Amazon Sales Order to Invoice

      Hi there, We need  advice on the Amazon integration with Zoho Inventory. Now, we want to convert all the Sales orders synced from Amazon to Invoices. We want also to include and record the Amazon fees associated with the sales (Amazon fees, FBA fees, Cost of Advertising etc.) However, Sales order only captures the sales proceeds (Gross Sales) in Zoho Inventory. Does anyone currently work with Amazon and can suggest how to correctly process the sales and Amazon payments through Zoho Inventory and
    • Zoho Inventory | Can't uncheck/turn off Advance Tracking

      Hi, I wanted to know if there's a way to turn off Advanced Tracking (such as Serial Number or Batch Tracking) for an item in Zoho Inventory. I’ve read that you might need to delete associated transactions and clear the opening stock to disable these features.
    • Landed Cost application to Vendor Bills from dropship Purchase Orders

      When trying to apply a Landed Cost to a Vendor Bill generated from a dropship Purchase Order, the Landed Cost pop-up window generates a message that "Landed Cost cannot be applied to Bills from dropship Purchase Orders" when trying to save the landed
    • 2 serial numbers for 1 item (Mac address and Serial number)

      There is a way to track 2 serial number type for 1 Item. Ex: Some electronic devices have a MAC address and a serial number. I need to track those 2 numbers
    • Zoho Projects Roadshow, USA - 2024

      Dear Users, We are happy to announce the Zoho Projects Roadshows 2024 in USA. This is an excellent opportunity to learn more about Zoho Projects and gain in-depth knowledge of the advanced features. Our team will also discuss industry specific solutions
    • Next Page