November Happy Hour will be moved to Thursday December 5th.

Aniket
Mar 5, 2019
  2009
(1 votes)

Alexa skill integration with Episerver - Part 1

We all know Episerver is a very powerful Enterprise CMS. The content authors and marketers have complete control over content, personalization, analytics as well as access to user data at their finget tips. 

With that said, the technological landscape is changing and so is user interaction with new innovative devices. In my opinion, websites (including responsive mobile websites) will always be the most popular way for presenting information, but as developers & marketers we should be prepared for this giant wave of new trend heading our way. Example: "50% of all searches will be voice searches by 2020". Episerver is prepared with it's Headless API to allow developers and marketers to ride the wave with ease. Episerver headless API allows serving same content to various devices including voice devices, mobile apps and others.  

I recently implemented an Alexa skill that queries Episerver CMS and returns meaningful data to Alexa device. Though this is a very basic version/proof-of-concept for an Alexa skill it opens up a whole lot of possibilites depending on your user's interaction with the website. The Alexa skill I implemented reads out the two latest news or events from a website. This can very well be extended to "Give me the store locations for XYZ near Boston", "Are there any new promotions for ABC?", "Company's profit summary for this quarter". You get the point :) 

As an end user, if you can get quick information from your favorite brand without having to spend time searching for it on a website, it's a huge value add in terms of convienience and saved time. No more booting up a device, navigating to a website, typing in a search box, enduring frustrating UI and performance issues. Simply ask "Alexa" what you need and listen to it while getting ready to go to work or during commercials on TV. If you are a technology (or tech savvy) organization it's even more important to display innovation to let your users know that you always "keep up" with new trends in technology.

Alexa Skill:

The core Alexa concept is pretty simple. It consists of:

  1. Alexa skill kit (Front-end code) - https://developer.amazon.com/alexa/console/ask 
  2. Lambda function (Back-end code) - https://aws.amazon.com/lambda/ 

You will need to setup 2 accounts:

  1. Amazon Developer account (to configure front end interactions using Amazon provided UI)
  2. AWS account (to host the back end code called lambda function)

NOTE: Amazon Developer Account has a BETA feature that allows you to host the skill and the code in the same interface which is a super convinient and easy to understand. This is highly recommed if you want to get your Alexa skill up and running in minutes. When you create a new skill select the option "Alexa Hosted (Beta)" and you should be able to host and update the code in the same Amazon developer account.  

Definitions:

Skill Name: The name of the skill that will be used when you publish your skill to Amazon.

Invocation Name: The term user will call out to invoke/start interaction with your skill. For ex: If the invocation name is "Fun Demo" the user can say Alexa open "Fun Demo" or Alexa start "Fun Demo"

IntentIntents allow you to specify what a user will say to invoke the skill. For ex: Get me the latest news or find me the closest stores in Boston area. You can create a custom intent as well as update the out-of-the-box Amazon provided Intents (such as CancelIntent or HelpIntent).

Slots: Slots are nothing but parameters you can pass to the Intent to allow dynamic terms. For example: Order me {number} {size} pizza. The terms number and size are two dymamic parameters passed to the Intent.

Endpoint: Endpoint is to connect your front end code (Invocation, Intents) to the backend code. If you are using Alexa hosted beta feaure, then no configuration is necessary. If the back end code is self-hosted (or a rest end point) these values need to be configured. The end point can be a REST endpoint which returns valid data or a lambda function that hosts your backend code. 

To get started, as a first step I recommend setting up a simple Web API REST endpoint in Episerver that returns a JSON object. Ideally you would want to setup Episerver Headless API but for a quick demo a simple REST endpoint should be enough.

I will get into the details of Alexa skill implementation and integrating it with Episerver in my next blog post.


Stay tuned!

Mar 05, 2019

Comments

Bien Nguyen
Bien Nguyen Mar 6, 2019 04:31 AM

Interesting topic! Waiting for next parts :)

Peter Bennington
Peter Bennington Mar 6, 2019 09:31 AM

I'm also looking forward to the rest of this series. This is something I am interested in creating a POC for, although I believe I will do it with the nuget package https://github.com/joseftw/JOS.Epi.ContentApi , which seems like it might be quicker. Unsure about performance and security though.

David Knipe
David Knipe Mar 6, 2019 10:53 AM

Interesting post and thanks for sharing! If you wanted to take some inspiration on using the Content Delivery API in an Alexa skill then I wrote about it here (search for Alexa in the page): https://www.david-tec.com/2018/06/episerver-as-headless-episerver-ascend-2018-presentation/ 

Please login to comment.
Latest blogs
AsyncHelper can be considered harmful

.NET developers have been in the transition to move from synchronous APIs to asynchronous API. That was boosted a lot by await/async keyword of C#...

Quan Mai | Dec 4, 2024 | Syndicated blog

The search for dictionary key

Recently I helped to chase down a ghost (and you might be surprised to know that I, for most part, spend hours to be a ghostbuster, it could be fun...

Quan Mai | Dec 4, 2024 | Syndicated blog

Shared optimizely cart between non-optimizley front end site

E-commerce ecosystems often demand a seamless shopping experience where users can shop across multiple sites using a single cart. Sharing a cart...

PuneetGarg | Dec 3, 2024

CMS Core 12.22.0 delisted from Nuget feed

We have decided to delist version 12.22.0 of the CMS Core packages from our Nuget feed, following the discovery of a bug that affects rendering of...

Magnus Rahl | Dec 3, 2024

Force Login to Optimizely DXP Environments using an Authorization Filter

When working with sites deployed to the Optimizely DXP, you may want to restrict access to the site in a particular environment to only authenticat...

Chris Sharp | Dec 2, 2024 | Syndicated blog

Video Guides: Image Generation Features in Optimizely

The AI Assistant for Optimizely now integrates seamlessly with Recraft AI, providing advanced image generation capabilities directly within your...

Luc Gosso (MVP) | Dec 1, 2024 | Syndicated blog