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

        • Getting error "invalid warehouse_id" when trying to update any transaction in Zoho books

          I got a message from Zoho saying that the Warehouse and Branch has been merged into one category "Locations" Once I migrated to this setup I was no longer able to edit any invoice / create creadit notes - got an error saying "invalid warehouse_id" I never
        • Access invoice custom modules data from API

          Hi, I am using $url = "https://www.zohoapis.eu/invoice/v3/invoices"; $opts = ["http" => [method" => "GET",header" => [ "Authorization: Zoho-oauthtoken $accessToken", "X-com-zoho-invoice-organizationid: $orgId" ] ] ]; From my app to retrieve the invoices,
        • It would be very helpful to be able to use variables in the formula columns

          Currently, variables can be used only in aggregated formulas. It would be great to be able to use them in regular formulas as well
        • Bulk Update API

          I’m reaching out to see if anyone has updates on the bulk records feature release. We’re eager to leverage this functionality for our operations, but until it becomes available, our current API call limits are proving to be a bottleneck—even after upgrading
        • Proper syntax for filtering Added_Time in the URL using functionality-based URLs

          I haver intermediate knowledge of functionality-based URLs. I say that because when I use them, it is never straight forward with me. Sometimes it works first try, and sometimes I spend hours exploring to find the proper syntax. link to operators: https://help.zoho.com/portal/en/kb/creator/developer-guide/others/url-patterns/articles/functionality-based-urls#List_of_operators_and_their_constants
        • AI that checks text content quality and for plagiarism

          Hello, A client has a requirement where the users will be typing in content consisting of multiple paragraphs in Creator. The text box will be checked for plagiarism and also for its quality. What would be the best approach for that?
        • 404 Error When Using record_cursor in ZOHO.CREATOR.DATA.getRecords (js api)

          Iam working on fetching all records from a Zoho Creator report using the Get Records API (V2.1) with the following recursive function: js CopyEdit // Recursive function to fetch records using record_cursor from the response function fetchAllRecords(recordCursor
        • Reusable Variables

          I’d like to know if there’s a way to store variables in Zoho Analytics that I can use in metrics or calculations. For example, I have a Currencies table that stores the value of different currencies over time. I’d like to use the value of the US dollar
        • Linking Purchase Orders to Task budgets

          Hi, We are a construction company within the mining industry. Our projects usually have fixed budgets (Cost budgets per task). Is it possible to link Purchase Orders to task budgets? I know you can link the Purchase order to a project, but this is not
        • Introducing prompt builder in Zoho CRM

          We’ve introduced a new way to put Zia’s generative AI to work—right where your teams need it most. With the all new prompt builder for custom buttons, you can create your own AI instructions to generate tailored content, suggestions, or summaries across
        • Create Tasklist with Tasklist Template using API v3

          In the old API, we could mention the parameter 'task_template_id' when creating a tasklist via API to apply a tasklist template: https://www.zoho.com/projects/help/rest-api/tasklists-api.html#create-tasklist In API v3 there does not seem to be a way to
        • Facing issue in getting data through api calls

          I have send data of users and want to get the data oof users but facing issue with one field for that I want help
        • invokeURL to change custom field

          I have a deluge script that currently runs as a Schedule. It works exactly as intended, however I've recently been informed by Zoho that there's some mechanism in place to block changes made by a script when it runs on a schedule from being detected by
        • How to stop workflow running twice on a record

          Hi I have a workflow as below Trigger: Lead record is created/edited - Repeat this workflow whenever a lead is edited is NOT TICKED Condition: When Lead Stage is MQL Action: Reassign Lead, Create Task If the Lead goes into stage MQL, and then it changes
        • Customize the ticket ID for enhanced ticket tracking

          Hello everyone, Ticket IDs in Zoho Desk are the unique reference numbers that are assigned to tickets when they're created. Agents generally use the ticket ID to locate a particular ticket and to reference a ticket in conversations and feeds. When customers
        • FSM Function not executing

          Good Afternoon, all I am working on a workflow function in FSM and yesterday it was working fine. Now today when I select "Save & Execute" it does nothing. I even tested it with just a info statement and it is not executing. Any help would be greatly
        • DKIM cannot be enabled for the domain as no verified default selector present

          Can't get the DKIM working. May you please check my account (nksy.us) to see what's wrong?
        • Boost collaboration in your sales process with Team Selling and Deal revenue's Split—empowering your Zoho CRM for smarter teamwork!

          This feature is currently available for the AU and SA DCs. It is being rolled out in a phased manner and will be available to all users shortly. Hello everyone, As you may all know, closing a deal is rarely a one-person effort. It often involves multiple
        • Create modules using natural language prompts

          Hello all, We’ve introduced a new enhancement to Zia that allows you to create custom and team modules in Zoho CRM using plain language prompts. Why this enhancement? Creating a custom module traditionally involves multiple steps—choosing field types,
        • Suggesting enhance for criteria based data-sharing rules

          I suggest that, for user fields, the logged-user system variable could be used. This would allow the user, for example, to access records in which he/she is mentioned in a specific field, other than the owner. Thanks! Eduardo
        • How to sync read mails to GMail?

          Hello I am testing Zoho TeamInbox but I have an issue with my connected GMail account. Whenever I read a mail in TeamInbox or even reply to it, the email stays as "unread" in GMail. Is this normal behaviour? I thought that with the 2-way sync of IMAP
        • Look up field and show or hide section based upon selection

          Hi there, I am looking to show or hide a section within the opportunities module based on the value of the selection in the look-up field. This feature does not seem to be there Is there a workaround, and is this option coming in a future release? Thanks
        • eway Bill - Import (Good / Material)

          As we Importer of goods , for That first we Generate PO then , Payment, then after We create Bill of Entry  After Bill of Entry Anywhere (99%) cases material that arrived to port that comes to warehouse / factory for that Eway bill , we have to create
        • Import of Bank Statement DO NOT work - Date Mapping issue - Basic Feature Issue Becoming Serious Pain

          Hello, Yes, This is True. Importing Bank Statement feature is Not working as Intended. Facing few issues. Specially regarding the Mapping of Date field format. No matter how many times, we create a Case with Support team, they are NOT supporting in proper
        • Approval Workflow for Purchase Orders Abrir

          The requirement is , that all purchase orders greater than or equal to 5000 go through an approval process from certain people, but within books I only see that the approvers can be by levels or any approver but we cannot enter a rule like these. Can
        • How to see and amend Primary Clients easily

          Hi, i'm trying to make some reports on the clients we do projects for. However, i'm seeing a lot of "unknown" clients in the Zoho Analytics report. I suspect that these projects have not been assigned well and this needs to be corrected. Where can i easily
        • ZOHO NEEDS TO CREATE AN OPTION TO PASS CREDIT NOTE AGAINST SALES RECEIPT

          Zoho needs to find a way to pass credit note on sales receiptS. Creating a dummy invoice is causing major issues in tallying our sales figures and compliance with tax authorities.My system is tied to tax agencies and trying these options causes major
        • INTERGRATION OF ZOHO BOOKS PREMIUM PLAN AND ZOHO INVENTORY STANDARD PLAN

          Hello. I was using Zoho Books premium plan with 3 branches and has been working well until I purchased Zoho Inventory Standard plan. Now my 3rd branch location has been deactivate din Zoho Premium. how can I solve this please since I use all the locations
        • Exporting Templates

          I have just spent 2 hours creating a project template for a Netsuite configuration, and want to share it with other Zoho Projects users - who have a different account. Is there any way to do this?
        • It's time to say goodbye to Zoho Recruit for me.

          Hello, I have been a Zoho Recruit user since 2013. The tool has evolved, with a better UI, new features and so on. The pricing is still a great asset too. BUT, that being said, important features are not coming fast enough. I tried to share my point of
        • Automation#34: Schedule Guided Conversations (GC) Based on Business Hours

          Hello Everyone, Welcome to this episode on configuring your Guided Conversations (GC) based on your business hours. In our previous episode on Guided Conversations, we covered how to set up GC to enable offline support. This time, we'll guide you through
        • Download PDF from File Field with the name in another single line field

          Hi I am storing a PDF file in a File Field of a Form using Zapier automatically. now i need to download that file and set its file name as per the value stored in a single line field in that form. ANy turnout for that Thanks
        • Custom Module missing SDK function fetchRelatedRecords(...) in a Client Script

          Good day, We have added a new module with a Multi-Lookup relation to Contacts.  When we tried to use the fetchRelatedRecords(id, related_list_api_name) function to get Related Records it is missing for our new custom module. https://js.zohocdn.com/crm/5124797/documentation/DotSDK/Modules.html
        • TeamInbox and Desk Integration is Broken

          I use the TI -> Desk integration a lot. Today, it broke, again. When I go to create a Ticket from TI, an error message on a red background is shown "oops something went wrong". Checking the developers console on my browser, there are many 500 errors relating
        • Couldn't connect to host, port: wordpress2224249.home.pl, 143; timeout 10000

          Hey, i get a error up "Couldn't connect to host, port: wordpress2224249.home.pl, 143; timeout 10000" But i tried same passwords and info. to make imap on hotmail. and it works flawlessly. Has to be something with zoho....
        • Reply-To Match condition for Inbound Mail Messages

          I've trying to setup a rule to match the "reply-to" header but can't find any condition that would match this in Zoho TeamInbox rules. The business case is that I've setup my team inbox to be a member of a google group. The result of that is that emails
        • No Emails Flowing To Zoho TeamInbox

          From today, any emails we send to our TeamInbox addresses fail to be delivered. Our TeamInbox is connected via IMAP to 2 x Zoho Mail accounts. If I log in to those accounts directly via Zoho Mail, I can see all the emails landing in the inbox. The emails
        • How to download Renamed File that already updated to Zoho Creator.

          Hi members, I construct a button with report workflow. link = "https://creatorexport.zoho.com" + zoho.appuri + "report_link_name/File_upload/image-download/" + input.File_upload; openUrl(link,"new window"); This script able to download the file. But I
        • Merge Join PDFs Zoho Creator

          Hi all, I have a field where users upload PDF, is it possible to join those pdfs into one with a function or something? Regards.
        • Project Statuses

          Hi All, We have projects that sometimes may not make it through to completion. As such, they were being marked as "Cancelled". I noticed that these projects still show as "Active" though which seems counter intuitive. In fact, the only way I can get them
        • Next Page