{"id":776,"date":"2021-05-14T01:43:02","date_gmt":"2021-05-14T01:43:02","guid":{"rendered":"https:\/\/salarydistribution.com\/machine-learning\/2021\/05\/14\/authenticate-chatbot-users-with-sms-one-time-passcode\/"},"modified":"2021-05-14T01:43:02","modified_gmt":"2021-05-14T01:43:02","slug":"authenticate-chatbot-users-with-sms-one-time-passcode","status":"publish","type":"post","link":"https:\/\/salarydistribution.com\/machine-learning\/2021\/05\/14\/authenticate-chatbot-users-with-sms-one-time-passcode\/","title":{"rendered":"Authenticate chatbot users with SMS one-time passcode"},"content":{"rendered":"<div id=\"\">\n            <!-- begin main body content --><\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>In this code pattern, learn how to authenticate users on your chatbot with an SMS one-time passcode (OTP).<\/p>\n<h2 id=\"description\">Description<\/h2>\n<p>Chatbots are prevalent everywhere. And, some conversations are confidential, so chatbots must verify the authenticity of its users. One example of this is a customer who holds an insurance policy who uses a chatbot to get more information about that insurance policy. Sending a one-time passcode through SMS is a popular way to identify a user.<\/p>\n<p>This code pattern shows how to build a chatbot that authenticates users through an SMS one-time passcode. You also learn to use IBM Watson Assistant, IBM Cloud Functions, and custom APIs to build this application.<\/p>\n<p>After you have completed this code pattern, you understand how to:<\/p>\n<ul>\n<li>Build conversational interfaces into any application, device, or channel<\/li>\n<li>Run your application code without servers<\/li>\n<li>Build APIs to authenticate users on your chatbot<\/li>\n<li>Make external API calls through Watson Assistant<\/li>\n<\/ul>\n<h2 id=\"flow-diagram\">Flow diagram<\/h2>\n<p><img class=\"lazycontent\" data-src=\"https:\/\/developer.ibm.com\/developer\/default\/patterns\/authenticate-users-on-your-chatbot-with-sms-one-time-passcode-otp\/images\/authenticate-users-on-chatbot-sms.png\" alt=\"Authenticate users on your chatbot flow diagram\"><\/p>\n<ol>\n<li>The user registers for a policy on the portal.<\/li>\n<li>User data is stored in the database, and policy details are sent to the user\u2019s phone number in an SMS through the Twilio Messaging API.<\/li>\n<li>The user interacts with the chatbot and asks for confidential information that is related to the policy. Watson Assistant prompts the user to enter the OTP.<\/li>\n<li>The query is sent to Watson Assistant, which in turn invokes IBM Cloud Functions to make an API call to the user-defined, back-end API for retrieving information.<\/li>\n<li>The database is searched for the user\u2019s phone number, and the OTP generated by the back-end API is sent to the user through Twilio.<\/li>\n<li>The user enters the OTP in the chat application to authenticate themselves.<\/li>\n<li>Watson Assistant validates the OTP by interacting with the back-end API.<\/li>\n<li>The user-requested confidential information is fetched from the database if the OTP is valid.<\/li>\n<li>IBM Cloud Functions returns the confidential information to Watson Assistant.<\/li>\n<li>Watson Assistant displays the user-requested confidential information.<\/li>\n<li>The user can see the confidential information in the chatbot.<\/li>\n<\/ol>\n<h2 id=\"instructions\">Instructions<\/h2>\n<p>Find the detailed steps in the <a href=\"https:\/\/github.com\/IBM\/authenticate-users-on-your-chatbot-with-sms-otp\/blob\/master\/README.md\">README<\/a> file. Those steps explain how to:<\/p>\n<ol>\n<li>Clone the repository.<\/li>\n<li>Set up the Twilio messaging service.\n<ol>\n<li>Create the Twilio service.<\/li>\n<li>Create the Twilio Trial Number.<\/li>\n<li>Verify caller IDs.<\/li>\n<\/ol>\n<\/li>\n<li>Deploy custom APIs.<\/li>\n<li>Create an IBM Cloud Functions action.<\/li>\n<li>Create Watson Assistant services.<\/li>\n<li>Import the Watson Assistant workspace.<\/li>\n<li>Configure Watson Assistant with the IBM Cloud Functions URL.<\/li>\n<li>Deploy and run the web application.<\/li>\n<\/ol><\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/developer.ibm.com\/patterns\/authenticate-users-on-your-chatbot-with-sms-one-time-passcode-otp\/<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/776"}],"collection":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/comments?post=776"}],"version-history":[{"count":0,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/776\/revisions"}],"wp:attachment":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media?parent=776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/categories?post=776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/tags?post=776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}