Alexa Content App with Media in Native Mode

(Audio, Video, & Images)

Objective:

This document will show you how to use the Content app that displays native video or image in Alexa.

Introduction to API:

The VoiceWorx platform can retrieve native content (Video, audio image) for consumption in an external device with capability to interpret and present this media type. To demonstrate this ability, we will upload a video content and define an Alexa skill intent that can be invoked to display this video.

Goal:

Our goal is to demonstrate the capability of the VoiceWorx platform to manage native content and respond to intent requests from devices that have the capability to display those content with appropriately formatted response data. We will create an Alexa Skill named Native Content. This skill will define a PlayVideo intent that retrieves and plays a video content stored/defined in the VoiceWorx platform.

Pre-requisites

  1. An active AWS Account

You should have an active AWS Account. If you do not have it, you can create an AWS account at https://portal.aws.amazon.com/billing/signup#/start

AWS Accounts Include 12 Months of Free Tier Access

  1. A VoiceWorx Account

For steps to create a VoiceWorx account, follow the steps at https://docs.voiceworx.ai/general/voiceworx-create-account

  1. A Skill in the VoiceWorx account

You should have created a skill and should have at least one Utterance in it.

  1. Access Key, Secret access key and AWS Region Name To be able to connect to Amazon Lex from the VoiceWorx platform, one IAM user is required and user should have the required permissions to access Lex service.

Following is a json document which you can use to create an IAM policy and assign it to the IAM user in the AWS console.

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. Ensure you Login With Amazon (LWA) account is setup by your admin. If you are the account admin, you can follow this instruction to set it up.

  2. Setup A DataSource

  3. Upload Content in VoiceWorx

  4. Create a custom skill in Voiceworx.

  5. Publish the skill

  6. Enable the skill in alexa.amazon.com

  7. Test in Echo Show

Setup an Internal Content Data Source

  1. Sign in to the VoiceWorx platform https://portal.voiceworx.ai/ and use navigation menu on left side. go to Integration Menu and select Connect System

  2. And click “Connect External System” button

  3. Select “Custom” as Integration Category, Select Internal “Content System Type”, select the System Instance Name to “Native Content Integration” and click “Connect System

    • Internal Category: Custom

    • System Type: Internal Content

    • Service Instance Name: Native Content Integration

Upload Content in VoiceWorx Platform

  1. Login into the VoiceWorx platform https://portal.voiceworx.ai/account/login, expand the “Content” menu on the left side and select “Content” then click “Content Categories”. Click on “Add New Category”.

Then enter or select the following:

    • Content Category: Native Video

    • Description Native Video

    • Click: Add

  1. Return to the left navigation menu and select “Content” then select “Content”.

  1. You can now create content in two ways:

  2. Add New Content

Users can upload their own Html, SSML and media files to create contents.

  1. Create Content from Template

Allows users to create a content using inbuilt Content Templates provided by VoiceWorx.

  1. Click “Add New Content” button.

Perform the following activities to add new content.

    • Content Name: Native Video

    • Content Code: Native Video

    • Category: Native Content

    • Text: Native Content

    • Media: Check box and select the

    • Media Type: Video

    • Media Source: Upload File or Media URL. Select Media URL if you have a publicly accessible media source, else you can select a file on your machine. For demo purpose here, we are uploading file from local device.

    • Upload File: If you choose to Upload File, you shall be able to Upload File.

    • Media URL: If you select to provide Media URL, the URL that you provide here shall be publicly accessible. You can provide the following sample data if you want to create content using Media URL. (URL: https://demovideo.s3.amazonaws.com/demo_video.mp4)

    • Click: Fill details as shown below and click on Add.

Create Custom Skill in Voiceworx.ai

  1. To create a custom skill in VoiceWorx click the left navigation menu and select “custom skills” then select “manage skills”. Click “Create New Custom Skill”.

Then enter or select the following:

    • Name: Native Content

    • Custom Skill Type: Search

    • Category: Native Video (This should be same as the Category of the Content).

    • Click: Save

  1. In the top menu tabs, select “Data Sources” then “Create New Data Source”.

Then enter or select the following:

    • Name: Native Content DS

    • Integration Configuration: Internal Content: Native Content Integration

    • Click: Save

  1. In the top menu tabs, click “Methods” then select “Create New Method”.

The Method has following parts:

        1. Method Inputs

        2. Method Output

        3. Method Result

        4. Result Options

        5. Lex Options

        6. Session Attributes

For this method, we are going to use Method Inputs, Method Result and Result Options.

        1. Fill the following fields in Method Inputs tab.

    • Method Name: PlayVideo

    • Request Type: Content

    • Content Name: {{Video}}

    • Category Name: Native Video

  1. Now in Method Result tab. Fill following information.

    • Empty Result Template: Requested video cannot be found. How else can I help you?

    • Result Template: Here is the requested video {{MediaUrl}}. How else can I help you?

    • Click: Save and Test

  1. In the resulting test screen, type “native video” into the Video textbox. Note: “native video” is the name of the content we uploaded in the previous steps above. The test screen only proves and shows that the VoiceWorx platform can retrieve your uploaded content and construct the appropriate response to a requester.

  2. Before moving to another step, let’s test whether the method is working fine or not. Click on the ‘Test’ button in the newly created method.

For Test purpose, you need to fill out the parameters. In our case, we have one parameter {{Video}} for ContentName. Fill the following details:

Video: Native Video (This name shall match with that of the content created in Step 17).

  1. The next step is to create Intents. In the top menu tabs, click “Intents” and then click “Create New Intent”.

Then enter or select the following options:

    • Name: PlayVideo

    • Intent Type: Search

    • Datasource: Native Content DS

    • Method: PlayVideo

  1. Now you want to create Slots. Slots correspond to the parameter that you want to use in your app. In the top menu tabs select “Slots” then select “Create New Slot”. Note the re-prompt message is what Alexa will ask if it can’t fill/resolve the video slot.

Then enter or select the following options:

    • Name: Video

    • Re-prompt Message: What is the video name

    • Type: Text

    • Custom Skill: Native Content

    • Intent: Play Video

    • Click: Save

  1. After creating slots, now you have to create utterances. Utterances are words spoken to launch specific intents. In the top menu tabs select “Utterances” then select “Create New Utterance”.

Then enter or select the following options:

    • Value: Show me {Video}

    • Custom Skill: Native Content

    • Intent: PlayVideo

    • Click: Save

  1. In the top menu tabs select “Input” then select “Create New Input”.

Then enter or select the following options:

    • Name: video

    • Description: (leave blank)

    • Custom Skill: Native Content

    • Custom Intent: PlayVideo

    • Data Source: Native Content DS

    • Data Source Method: PlayVideo

    • Click: Save

Publish to Alexa

Then enter or select the following options:

    • External Skill Name: 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. In this case we named it “Native Content”.

    • Skill Type: Search

    • Channel: Alexa

    • Ensure the following are not checked: Require Account Linking & Auto Publish

    • External Skill ID: (This information will automatically drop in this field).

    • Skill Invocation: 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. For this step we used “native content test”.

    • Welcome Message: Welcome to Native Content Test. How can I help you?

    • Reprompt Message: You can say “play video, native video” or say “help” for more guidance. How else can I help you?

    • Help Message: You can ask me to play a video, by saying play video, native video. To exit native content, say exit.

    • Goodbye Message: Thank you for using native content, goodbye.

    • Fallback Message: I am sorry I didn’t understand that. How else can I help you?

    • Optional: Replace all placeholder values in all “Message”

    • Uncheck: Enable Address, Full Address, Region & Postal Code, etc. (Settings shown in the images below).

    • Click: Save

  1. On the resulting screen click “Publish To Alexa”.

  1. Select your login with Amazon profile then click “Publish To Alexa”.

Then enter or select the following options:

  • Selected Skill: Native Content

  • Select Amazon Account (LWA)

  • If you do not have an Amazon Account for LWA, click on the “Add Amazon Account for LWA” to set up. Select the LWA account setup by your admin and

  • Click: Publish To Alexa

  1. On the resulting screen, ensure that a success message shows for the publishing steps before clicking “Go To Alexa Skill”. If success message does not appear, go back to Publishing to fix any issue shown in publishing result.

  1. On the Alexa skill page, ensure “Full Build Successful” message appears in bottom right corner before starting to test skill.

  1. Click on left navigation menu select “Slot Types” then click “Interfaces”.

    • Enable the “Video App” interface

    • Click “Save Interfaces” at the top of the page after enabling the Video APP interface.

  1. At the top of the page click “test” tab and change the skill test status to from “Off” to “Development

  1. Now invoke the skill using skill invocation text. After successful invocation, call the skill.

  1. Since this is a video skill, the developer console does not support this. Hence, you have to invoke the skill from device. You have to enable the skill to be able to invoke it from your device.

Enable Skill

  1. Select “Skill” on left navugation menu, then select “All Skill”.

  1. Select “Native Content” skill and click “Enable” button.

Echo Show Set Up

  1. To setup your Echo Show follow this tutorial from Amazon.

  2. To ensure that Echo Show language is set to English US.

Please select the following:

    • Slide down the top downward pointing arrow button in Echo Show

    • Click: Device Option

    • Select: Device Language

    • Ensure its on English (US)

    • Invoke the skill in Echo Show by Saying “Alexa open Native Content test”

  1. Play video skill by saying “show me native video”.

Note: Native Video was the content name for the video we set up in step 18 above.

Congratulations! You have successfully completed building

Alexa Content Skill with Media in Native Mode.

Note: App and skill are interchangeably used in the document.

Last updated