{"id":3445,"date":"2018-08-09T10:00:56","date_gmt":"2018-08-09T08:00:56","guid":{"rendered":"https:\/\/www.recolize.com\/?p=3445"},"modified":"2018-09-11T18:05:34","modified_gmt":"2018-09-11T16:05:34","slug":"how-to-build-an-alexa-skill-for-your-online-shop-with-recolize-in-15-minutes","status":"publish","type":"post","link":"https:\/\/www.recolize.com\/en\/blog\/how-to-build-an-alexa-skill-for-your-online-shop-with-recolize-in-15-minutes\/","title":{"rendered":"How to Build an Alexa Skill for your Online Shop with Recolize in 15 Minutes?"},"content":{"rendered":"<section class=\"section  text-normal section-text-no-shadow section-inner-no-shadow section-normal section-opaque\"  >\n    \n    <div class=\"background-overlay grid-overlay-0 \" style=\"background-color: rgba(0,0,0,0);\"><\/div>\n\n    <div class=\"container container-vertical-default\">\n        <div class=\"row vertical-default\">\n            <div class=\"col-md-12     text-default small-screen-default\"  ><div class=\"col-text-1 text-normal  element-top-20 element-bottom-20\" data-os-animation=\"none\" data-os-animation-delay=\"0s\">\n    <p>Building an Alexa Skill is very easy if you combine it with Recolize personalized product recommendations. In the following I will describe the required steps and during the course of this blog post we will develop a sample skill that you can use as a starting point for your individual skill. The sample skill is available on our <a href=\"https:\/\/github.com\/Recolize\/recommendation-engine-sample-alexa-skill\" target=\"_blank\" rel=\"noopener\">Github account<\/a>.<\/p>\n<p>We will create a so-called <a href=\"https:\/\/developer.amazon.com\/de\/docs\/custom-skills\/understanding-custom-skills.html\" target=\"_blank\" rel=\"noopener\">Custom Alexa Skill<\/a>\u00a0that will be able to simply answer the question &#8220;<em>Alexa, open Recolize and ask what can you recommend to me today?<\/em>&#8221; or &#8220;<em>Alexa, open Recolize and ask what is the recommendation for today?<\/em>&#8220;.<br \/>\nTherefore we need the Skill definition and additionally a AWS Lambda function that will trigger our Recolize recommendation API. The beauty of AWS Lambda is that you do not need to provision any servers but the so-called serverless framework will only be active if someone asks Alexa to trigger your skill. For more information on AWS Lambda functions see the official documentation.<\/p>\n<p>We use the official <a href=\"https:\/\/developer.amazon.com\/de\/docs\/smapi\/ask-cli-intro.html\" target=\"_blank\" rel=\"noopener\">Ask CLI commands<\/a>\u00a0to easily deploy both the skill itself as well as the Lambda function that will call the Recolize API.<!--more--><\/p>\n<\/div>\n<h2 class=\"text-left  element-top-0 element-bottom-0 text-normal normal default\" data-os-animation=\"none\" data-os-animation-delay=\"0s\" >\n    Steps<\/h2><div class=\"col-text-1 text-normal  element-top-20 element-bottom-20\" data-os-animation=\"none\" data-os-animation-delay=\"0s\">\n    <ul>\n<li>First &#8211; if you haven&#8217;t done already &#8211; register for the <a href=\"http:\/\/developer.amazon.com\/alexa\" target=\"_blank\" rel=\"noopener\">Amazon Alexa Developer Portal<\/a> in the upper right corner<\/li>\n<li>Clone our sample Github repository and step into the directory.<\/li>\n<li>Next step is to connect the Ask CLI with your Amazon Developer account:<\/li>\n<\/ul>\n<\/div>\n<div class=\" element-top-20 element-bottom-20\" data-os-animation=\"none\" data-os-animation-delay=\"0s\">\n    <pre>ask init<\/pre>\n<\/div><div class=\"col-text-1 text-normal  element-top-20 element-bottom-20\" data-os-animation=\"none\" data-os-animation-delay=\"0s\">\n    <ul>\n<li>Alexa Skills are triggered by the so-called &#8220;invocation name&#8221;, which means everytime you say &#8220;Alexa, open Recolize and ask&#8230;&#8221; the device knows which skill to activate. That&#8217;s why later on if you want to publish the skill under your name it is very important to put a lot of thoughts into a well-sounding, easy-to-remember and easy-to-pronounce invocation name.<br \/>\nBy default our sample skill uses the invocation name &#8220;Recolize&#8221; which you can change by editing the JSON files in the <em>models\/<\/em> directory.<\/li>\n<li>Afterwards we deploy the Alexa Skill with the Ask CLI. The deployment steps takes care of all the required actions like creating the Lambda function as well as the Skill including the Intents.<\/li>\n<\/ul>\n<\/div>\n<div class=\" element-top-20 element-bottom-20\" data-os-animation=\"none\" data-os-animation-delay=\"0s\">\n    <pre>ask deploy<\/pre>\n<\/div><div class=\"col-text-1 text-normal  element-top-20 element-bottom-20\" data-os-animation=\"none\" data-os-animation-delay=\"0s\">\n    <ul>\n<li>The final step we need to do is adding some parameters to the AWS Lambda function which is done as environment variables. Therefore <a href=\"https:\/\/www.recolize.com\/en\/contact-us\/\">send us a message<\/a> to request your Alexa Skill parameters and then go to the <a href=\"https:\/\/aws.amazon.com\/en\/console\/\" target=\"_blank\" rel=\"noopener\">AWS Developer Console<\/a>\u00a0and switch to the AWS Lambda Function section and select the Lambda Function &#8220;whatCanYouRecommend&#8221; (which was automatically created by our Recolize Skill). Then scroll down a bit to the section &#8220;Environment Variables&#8221; and enter the parameters that we sent you there:<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-3452 size-large\" src=\"https:\/\/www.recolize.com\/wp-content\/uploads\/2018\/08\/Bildschirmfoto-2018-08-05-um-23.42.40-1024x346.png\" alt=\"AWS Lambda: add environment variables\" width=\"1024\" height=\"346\" srcset=\"https:\/\/www.recolize.com\/wp-content\/uploads\/2018\/08\/Bildschirmfoto-2018-08-05-um-23.42.40-1024x346.png 1024w, https:\/\/www.recolize.com\/wp-content\/uploads\/2018\/08\/Bildschirmfoto-2018-08-05-um-23.42.40-300x102.png 300w, https:\/\/www.recolize.com\/wp-content\/uploads\/2018\/08\/Bildschirmfoto-2018-08-05-um-23.42.40-768x260.png 768w, https:\/\/www.recolize.com\/wp-content\/uploads\/2018\/08\/Bildschirmfoto-2018-08-05-um-23.42.40.png 1661w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/li>\n<\/ul>\n<\/div>\n<h2 class=\"text-left  element-top-0 element-bottom-0 text-normal normal default\" data-os-animation=\"none\" data-os-animation-delay=\"0s\" >\n    See It in Action<\/h2><div class=\"col-text-1 text-normal  element-top-20 element-bottom-20\" data-os-animation=\"none\" data-os-animation-delay=\"0s\">\n    <p>Enough theory, now let&#8217;s get to practice and see how this simple skill looks like in action. The demo video below shows the sample application with the use of an Amazon Echo Dot device:<\/p>\n<\/div>\n[vc_raw_html]JTNDaWZyYW1lJTIwd2lkdGglM0QlMjI1NjAlMjIlMjBoZWlnaHQlM0QlMjIzMTUlMjIlMjBzcmMlM0QlMjJodHRwcyUzQSUyRiUyRnd3dy55b3V0dWJlLW5vY29va2llLmNvbSUyRmVtYmVkJTJGWEJ0V1ZrODRvTnclMjIlMjBmcmFtZWJvcmRlciUzRCUyMjAlMjIlMjBhbGxvdyUzRCUyMmF1dG9wbGF5JTNCJTIwZW5jcnlwdGVkLW1lZGlhJTIyJTIwYWxsb3dmdWxsc2NyZWVuJTNFJTNDJTJGaWZyYW1lJTNF[\/vc_raw_html]<h2 class=\"text-left  element-top-0 element-bottom-0 text-normal normal default\" data-os-animation=\"none\" data-os-animation-delay=\"0s\" >\n    Some Final Advices<\/h2><div class=\"col-text-1 text-normal  element-top-20 element-bottom-20\" data-os-animation=\"none\" data-os-animation-delay=\"0s\">\n    <ul>\n<li>Testing of the Alexa Skill can either be done directly on the Alexa device or easily on your laptop with the excellent testing tool in the Alexa Developer Console<\/li>\n<li>We have released this sample code under the <a href=\"https:\/\/www.gnu.org\/licenses\/gpl.html\" target=\"_blank\" rel=\"noopener\">GPL<\/a> which enables you to use it in your own Alexa Skill projects<\/li>\n<li>Later on if you want to publish your own implemented skill the <a href=\"https:\/\/developer.amazon.com\/de\/docs\/custom-skills\/certification-requirements-for-custom-skills.html\" target=\"_blank\" rel=\"noopener\">official documentation for skill submission<\/a> is a good lecture<\/li>\n<li>Probably one of the first things you want to customize are the messages that Alexa replies. This can be done in the main JavaScript file <em>lambda\/custom\/index.js<\/em>. To only update the Lambda function after modification the following command is helpful after retrieving the ARN of the Lambda Function from the Developer Console:<\/li>\n<\/ul>\n<\/div>\n<div class=\" element-top-20 element-bottom-20\" data-os-animation=\"none\" data-os-animation-delay=\"0s\">\n    <pre>ask lambda upload -f arn:aws:lambda:###FILL THIS WITH YOUR INDIVIDUAL ARN###:function:whatCanYouRecommend<\/pre>\n<\/div><div class=\"col-text-1 text-normal  element-top-20 element-bottom-20\" data-os-animation=\"none\" data-os-animation-delay=\"0s\">\n    <p>That&#8217;s all it takes to build an innovative voice commerce skill!<br \/>\nOk perhaps I am exaggerating a bit but as you can see this sample skill is very, very easy to build with Recolize and you can now leverage all the Recolize features like static product lists, extensive filtering and so on in Alexa.<\/p>\n<p>What use cases come to your mind? I&#8217;m very excited to get to know.<\/p>\n<\/div>\n<\/div>        <\/div>\n    <\/div>\n<\/section>\n\n","protected":false},"excerpt":{"rendered":"<p>Building an Alexa Skill is very easy if you combine it with Recolize personalized product recommendations. In the following I will describe the required steps and during the course of this blog post we will develop a sample skill that you can use as a starting point for your individual skill. The sample skill is<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[25,152,153,40],"tags":[],"_links":{"self":[{"href":"https:\/\/www.recolize.com\/en\/wp-json\/wp\/v2\/posts\/3445"}],"collection":[{"href":"https:\/\/www.recolize.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.recolize.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.recolize.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.recolize.com\/en\/wp-json\/wp\/v2\/comments?post=3445"}],"version-history":[{"count":24,"href":"https:\/\/www.recolize.com\/en\/wp-json\/wp\/v2\/posts\/3445\/revisions"}],"predecessor-version":[{"id":4196,"href":"https:\/\/www.recolize.com\/en\/wp-json\/wp\/v2\/posts\/3445\/revisions\/4196"}],"wp:attachment":[{"href":"https:\/\/www.recolize.com\/en\/wp-json\/wp\/v2\/media?parent=3445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.recolize.com\/en\/wp-json\/wp\/v2\/categories?post=3445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.recolize.com\/en\/wp-json\/wp\/v2\/tags?post=3445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}