VoiceWorx.ai
Search…
Secure your VoiceWorx Skill with Multi-Factor Authentication

Objective

This document will demonstrate how to use the Custom Skill feature of the VoiceWorx platform with Multi-Factor Authentication (MFA) support.

Introduction to API

The VoiceWorx platform can integrate with external platform via web API’s. To demonstrate this capability, a demo API endpoint has been created (https://demo.voiceworx.ai/api/Contacts) in our demo web app “demo.voiceworx.ai”. Multiple API endpoints have been created for Contacts module and will be using the endpoint that searches an underlying Contacts database and returns the contact number of a specific person.
The demo web app created has the ability to perform CRUD operations against the underlying Contacts database that is triggered by calls to the exposed contact API’s in demo.voiceworx.ai
Web App URL : http://demo.voiceworx.ai
Here is a sample contact in the database.

Goal

Our goal is to demonstrate the capability of the VoiceWorx platform to integrate with external platforms and perform CRUD operations against them via web API calls with support for MFA. In this Alexa Skill it is called “Contact Finder”. This Alexa app will look up and return a person’s number that is stored in the contacts database and is accessible via the contacts API endpoints in demo.voiceworx.ai. The skill will be protected via a pin code sent to the users that invoked the skill’s phone and email. The MFA prevents unauthorized personnel from accessing the information provided by the skill. When a contact is asked and user has not authenticated with a PIN code, a 4-digit code is sent to the users email and phone number. When the correct pin code is provided by the user while interacting with the skill, access is granted but the PIN code is valid for five minutes. If a user does not interact with the skill within 5 minutes, on next interaction, a PIN code is regenerated and resent to the users email and phone number.
Note: the example uses Basic Authentication so username/passwords to the external resource is required.

Steps

The following shows the general steps/activities that will be carried out in setting up this integration. Note: It is advisable to use same email for signup across the 3 channels below. Step 1 -3 below are compulsory.
  1. 4.
    Ensure you Login With Amazon (LWA) https://developer.amazon.com/alexa/console/ask account is setup by your admin. If you are the account admin, you can follow this instruction to set it up.
  2. 5.
    Set up connection to the external web API
  3. 6.
    Create a custom skill in Voiceworx.
  4. 7.
    Publish the skill
  5. 8.
    Test the Alexa skill.

Set up connection to the external web API

  1. 1.
    Login to the VoiceWorx platform, use left navigation menu and click “Integration” then select “Connect System”. In the resulting page, click “Connect External Systems”.
Graphical user interface, text, application, email Description automatically generated
  1. 1.
    In “Connect External System” select or do the following:
Select Integration Category: Custom
Select System Type: Rest API Service
Click: Connect System.
Graphical user interface, text, application Description automatically generated
  1. 1.
    Once in “Rest API Service Setup” select or enter the following:
System Instance Name: ContactFinder
Authorization Type: Basic Auth
Add Web API URL: https://demo.voiceworx.ai
Under Basic Auth Settings
Enter Username and Password
Click: Validate System to ensure you have access to the web API endpoint.

Create Custom Skill in Voiceworx.ai

  1. 1.
    To create a custom skill, use left navigation menu and click “Custom Skills” then select “Manage Skills”. Then click “Create New Custom Skill”.
Graphical user interface, text, application, email Description automatically generated
  1. 1.
    Now add Custom Skill by entering or selecting the following:
Name: Contact Finder
Custom Skill Type: Search
Category: None
Click: Save
Graphical user interface, text, application Description automatically generated
  1. 1.
    In the top menu tabs, select “Data Sources” then “Create New Data Source”. Select or enter the following:
Name: ContactFinderDS
Integration Configuration: Rest API Service: ContactFinder
Manage Connections to create the external platform WebAPI integration
Click: Save
Graphical user interface, application Description automatically generated
  1. 1.
    In the top menu tabs, select “Methods” then select “Create New Methods”. Then select or enter the following:
Name: GetPhoneNumberByName
Request Type: GET
Query Path: ?name={{Person}}
Result Type: Record
Method Path: /api/contacts
Method Result-Empty Result Template: Phone Number Not Found For Requested Contact
Result Template: {{Person}} phone number is {{Phone}}
Click: Save
Graphical user interface, application, email Description automatically generated
  1. 1.
    In the top menu tabs, select “Intents” and “Create New Intent”. Then select or enter the following:
Name: GetPhoneNumberByName
Intent Type: Search
Intent Action: Executive Method
DataSource: ContactFinderDS
DataSource Method: GetPhoneNumberByName
Click: Save
Graphical user interface, text, application Description automatically generated
  1. 1.
    In the top menu tabs, select “Slots” and select “Create New Slot”. Note the Reprompt message is what Alexa will ask if it can’t fill/resolve the person slot. Then select or enter the following:
Name: Person
Slot Order: Blank
Reprompt Message: What is the person name
Type: Person
Custom Skill: ContactFinder
Intent: GetPhoneNumber
Click: Save
Graphical user interface, text, application, email Description automatically generated
  1. 1.
    In the top menu tabs, select “Utterance” and select “Create New Utterance”. Utterance are words spoken to launch specific intents. Now input or select the following:
Value: What is the phone number for (Person)
Custom Skill: ContactFinder
Intent: GetPhoneNumber
Click: Save
Graphical user interface, text, application Description automatically generated
  1. 1.
    In the top menu tabs, select “Input” and select “Create New Input”. Then input or select the following:
Name: Person
Custom Skill: ContactFinder
Custom Intent: GetPhoneNumber
Data Source: ContactFinderDS
Data Source Method: GetPhoneNumberByName
Graphical user interface, application Description automatically generated

Publish to Alexa

  1. 1.
    In the top menu tabs select “Publish” then click “Add Skill Publishing”. Then enter or select the following:
External Skill Name: ContactFinder. (This will be the name of the skill in Alexa. Therefore, make it unique and different from the names of your other skills in Alexa.)
Skill Type: Select Search
Channel: Select Alexa
Uncheck the following: Require account linking, Auto Publish
Skill Invocation Name: ContactFinder. (This will be what users say to launch your skill in Alexa. It must be in lower case alphabets cannot contain START, BEGIN, STOP, EXIT, LAUNCH and cannot contain number or special characters.)
Optional: Replace all placeholder values in all “Message”. Uncheck all the settings shown in the second image below except the Enable MFA check box
Click: Save.
Graphical user interface, text, application, email Description automatically generated
Graphical user interface, text, application, Word Description automatically generated
  1. 1.
    A slot named “Pin” will automatically be added for all intents.
  2. 2.
    In the top menu tabs select “Publish” then click “Publish to Alexa”.
Graphical user interface, text, application Description automatically generated
  1. 1.
    Once in Publish Skill to Amazon Alexa select and do the following:
Selected Skill: Contact Finder
Select Amazon Account: LWA Config
Select the LWA account setup by your admin or the one you set up in step 4 above.
Click: Publish To Alexa
Graphical user interface, text, application Description automatically generated
  1. 1.
    On the resulting screen, ensure that a success message shows for the publishing steps before clicking the “Go To Alexa Skill”. If success message not shown, click “Go To Skill Publishing” to fix any issue shown in publishing result.
Graphical user interface, text, application Description automatically generated
  1. 1.
    On the Alexa skill page, ensure “Full Build Successful” message is shown in bottom right corner before starting to test skill.
Graphical user interface, text, website Description automatically generated
  1. 1.
    Go to “test” tab in the top menu, then below “test” tab change the skill test status from “Off” to “Development”.
  1. 1.
    Invoke skill by typing the invocation name (Contact Finder) inserted in the publishing step in Voiceworx. If the invocation is successful, your configured welcome message will be displayed in the developer console.
A screenshot of a computer screen Description automatically generated
  1. 1.
    Invoke an intent and a pin will be requested
Graphical user interface, text, application, chat or text message Description automatically generated
Congratulations!
You have successfully completed a Secure your VoiceWorx Skill
with Multi-Factor Authentication.
Copy link
On this page
Objective
Introduction to API
Goal
Steps
Set up connection to the external web API
Create Custom Skill in Voiceworx.ai
Publish to Alexa