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

    • Sharing Knowledge Base articles across multiple departments

      It would be useful to share some Knowledge Base articles across multiple departments where they are applicable, rather than having to go into other departments to find the article you're looking for. For example. Our reception uses the 'Admin' desk whereas our IT guys use the 'Support' desk, however both divisions would find KB articles about our company intranet useful. Reception does not have access to the support desk, so cannot see articles created in the Support KB. Perhaps you could install
    • Contacts marked as Spam are shown as Contacts in tickets.

      Hi Zoho, If a ticket is marked manually as Spam you get an option to set the contact as Spam as well. It would be great if there was another option to delete this Contact. This would be based on the understanding that it wouldn't be marked automatically
    • Is possible to use ${webhookTrigger.payload.street==null?"No street":${webhookTrigger.payload.street}} for to detect inline a null parameter

      Hi Team I need to know if it's possible to evaluate inline the following parameter, with the objetive to detect a null value ? I would like to use ${webhookTrigger.payload.street==null?"No street":${webhookTrigger.payload.street}} Regards, Pablo
    • Real Estate CRM

      How can I tailor my CRM for real estate? I had seen an image where the CRM included property tabs.
    • Issue with Bulk Edit Triggering Function Multiple Times in Zoho Report

      In our Zoho report, we have observed an issue where executing a function during a bulk edit operation runs the function multiple times—once for each selected report entry. This behavior is causing errors due to overlapping or redundant executions. Our
    • Is there a Kanban view of Tasks across all Projects?

      As the title indicates, I could use a Kanban view of my Tasks across my Projects. If it's there, I don't see it. If it isn't there, I'd like to submit this as a feature request. Thx.
    • Set recurring tasks in Zoho Support?

      Hello,   We use the task function in Zoho Support to set reminders for "due dates" of important events, such as lease expirations, etc. Is it possible to set some of these as recurring yearly? As of now, we have to reset every task manually after one year. Is there a way to have it reset automatically?   Additionally, is there a way to import a list of tasks and their dates into Zoho Calendar? I have not been able to do it from Zoho Support to Calendar. I tried exporting tasks from Zoho Support,
    • Help - How Can I Enter a Hourly Rate (Global Cost) for our Team for Profitability Reporting?

      Hi everyone, I'm hoping someone can help as I am at a loss and am quite shocked (if true) at the lack of functionality in Zoho Books. We run a company in which we do hourly jobs for clients and we bill based on the hours of work completed. Projects are
    • Schedule a regular backup

      In CRM I have a regular backup setup. I cannot find an option to backup Desk? I would like to take a backup before I test syncing products between CMR and Desk.
    • Opening & working multiple tickets

      We work in multiple tickets at the same time. Currently to do this, we have to open multiple instances of Desk.  Is there a way to do this by just opening multiple ticket tabs within 1 instance of Desk?  
    • Limit who can submit a support ticket to your site?

      Does anyone have a use case for needing to limit who can submit tickets via your help portal? Some of our customers want to have end-users view our knowledge base articles and see tickets their IT groups have submitted but they do not want end-users to
    • Is there a way to request a password?

      We add customers info into the vaults and I wanted to see if we could do some sort of "file request" like how dropbox offers with files. It would be awesome if a customer could go to a link and input a "title, username, password, url" all securely and it then shows up in our team vault or something. Not sure if that is safe, but it's the best I can think of to be semi scalable and obviously better than sending emails. I am open to another idea, just thought this would be a great feature.  Thanks,
    • Allow us to disable the Reopen Ticket button after a ticket is closed

      Disabling the Reopen Ticket will allow us to have more control over the ticket's flow. According to support, this is currently not possible. Please add this to let us, the customers, mold the ticketing system into something that we can use for our business
    • How to Enforce Mandatory Fields (Category/Sub-category) Before Closing a Ticket?

      Hi, I'm currently using Zoho Desk and encountering an issue where agents are able to close tickets without filling out mandatory fields, specifically Category and Sub-category. I’ve already set them both as a mandatory field, but it can still be bypassed
    • Admin Control for Default Email Templates in Zoho Desk

      Hi Zoho Desk Team, We would like to request a feature enhancement related to default email templates. Currently, agents can select and set their own default email templates when replying to tickets. However, we believe this setting should be managed centrally
    • Lock out of account after password update

      This is a bit of a catch 22 situation. I updated my account password using password generator in ZohoValut. Now I am locked out of everything, as I cannot get into OneAuth for 2FA, as the password is randomly generated, without getting into ZohoValut,
    • Guidance on Making Zoho Desk Connections Available for All Data Centers

      Hi Team, I’m currently developing an application using Zoho Desk connections to manage OAuth for my third-party products. Could you please advise on the steps required to make it available across all data centers? Looking forward to your thoughts on
    • Multibrand Help Center - Share knowledge base catgories between multiple departments

      Hello, I would like to know if it is possible to share categories between multiple departments when the multi brand feature is enabled. So that then one portal exists per department, but certain categories are visible in multiple portals. After all, we
    • Unable to upload document error on zoho sign

      i am creating a document using laravel php and here is my code and i get this reponse {"code":2005,"message":"Unable to upload the document","status":"failure"} $path = storage_path($file); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://sign.zoho.com/api/v1/requests');
    • Cloud to cloud folder migration from Sharepoint to Workdrive

      I am aware of OneDrive migration: https://help.zoho.com/portal/en/kb/workdrive/migrations/microsoft/articles/migrate-from-onedrive-to-zoho-workdrive#Whats_migrated would this cover a Sharepoint migration meaning I can move a whole Sharepoint (team) folder
    • Zoho Sign / Prefill By You - Editable by Them!

      Zoho Sign seems to have two field options available - an empty field for signer(s) to complete or a field that has been prefilled by you, that becomes read only once sent.  What I would like is an option on the pre-filled by you fields, to leave them
    • How to sort a data in summary report with Monthly ?

      Hi Team, Can any one help me out how to sort a data based on monthly, Month was shuffled based on aliphatic order. i want to sort the below data monthy?
    • Is this link the transparent pixel used to track opens?

      Could someone please help me identify this highlighted link? It is automatically created by Zoho and a lot of contacts receiving campaigns will click on this link. I don't believe that it is the "update your preferences link" because on the Link Clicks
    • Kiosk Studio wrap-up | How our community used kiosks in 2024

      Hello, everyone! Happy new year! The end of 2024 has been busy, and 2025 promises to be bigger and better. As we ring in the new year, let's rewind and look at Kiosk Studio, our no-code customization tool. The past 300 days have seen the CRM community
    • Zoho Crm - Inventory Integration

      Hello, I need help about Map Fields between CRM and Inventory. For Example, I can't match amount of stock between these 2. I can put opening stock number  in Inventory but I can't see it on CRM. Also I want to see categories and parent categories on Inventory, in CRM too. Best Regards.
    • Inventory Valuation Method Feature

      Zoho added another feature so called Inventory Valuation Method of each Item. This is actually good to see and it will benefit us so much but I have a question on this. For Existing Items that already have transactions, Zoho made it a default and assumed
    • Where is the customization and extendibility of zoho inventory?

      After delving into zoho one subscription to test out systems we need for our business, I'm really disappointed after working in Zoho Inventory. Its features and customizability are extremely lacking compared to the other tools like CRM. In our case we
    • Organization Variables - Restrict Access

      Currently, there is no way to restrict the access to organization variables. This leads to a problem when storing API related values that should be kept secret as anyone with access to create and edit email templates, workflow rules, or inventory templates
    • Values in multi pick list are not copied to copied deal

      Hi, After a deal is completed in our sales funnel we copy the deal to an automatically created new deal in our project funnel. All fields are copied properly, but only a Multi Pick List is not copied. How can we copy the selected values in this field
    • Zoho takes too long to load...

      I am based in Europe and in the last couple of weeks, Zoho CRM takes minutes even to load modules. Is there a specific reason this is happening? Is this happening to other people?
    • Modules are continuously loading

      Hi! We are not able to open the task modules, it keeps continuously loading
    • Execution failure when fetching a Name field from another app

      In creator I have one app [Employee Directory] with a form [Employees]. One of the fields is a name field called [Name]. Here is a sample that works, if executed from the Employees app: test_Employee = Employees[Name.first_name == "Alex"]; info test_Employee.Name;
    • Accessing Subform Data using getRecordByID

      I am getting data from Zoho Creator using deluge zoho.creator.getRecordByID task, from another application. The report contains a subform, and that subform is in the detail view of the report. I do not appear to have any subform data in the JSON response,
    • Allow "add new" option to picklists and multiselection fields from add or edit pages

      Hello zoho, please insert an add option (ie +)sign) to pick and multiselect fields so we can add new options while entering or editing records. For example. in my lead module, while adding a new record, I realized I had a new lead source. I went to my
    • Allow customer to select meeting duration

      I would love to see a feature where I can give the customer the option to select the meeting duration they require based on a dropdown list which I have predefined in the service settings. For example: 15, 30, 45, 60, 90 minutes.
    • Can you internally tag/categorize posts for campaigns?

      Would love to easily sort through posts by tags or categories (i.e. we have multiple memberships and share studies from each. It would be nice to pull reports in a second for "membership A studies" for a campaign etc.).
    • Zoho and Hostaway webhok integration.

      I want to receive data coming from hostaway webhook and receive it in zoho crm to create or update record in a module based on conditions. The hostaway webhook sends data every time a reservation is created or modified or cancelled. The hostaway sends
    • Function 56: Automatically enable the option for customers to pay via bank account

      Hello everyone and welcome back to our series! One of the key features of Zoho Books is its integration with multiple payment gateways, allowing you to receive online payments for your invoices. This ensures faster payments, automates payment tracking
    • Connect multiple Facebook ad accounts to Zoho Social

      Hi there. I'm doing the Facebook Ads and Zoho Social integration to automate the leads that come from Potential Customer campaigns on Facebook to Zoho CRM. I have a company (1 fanpage, 1 brand), but within the business or brand on Facebook, I manage several
    • Custom service report or Zoho forms integration

      Hello, So far the experience with Zoho FSM and the integration with Books has been good, however there are limitations with service reports. As with my business, many organisations send technicians to different types of jobs that call for a different
    • Next Page