alexa-skill | A Ruby based DSL to create new Alexa Skills

 by   skierkowski Ruby Version: Current License: No License

kandi X-RAY | alexa-skill Summary

kandi X-RAY | alexa-skill Summary

alexa-skill is a Ruby library. alexa-skill has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

A Ruby based DSL to create new Alexa Skills. First, install the gem. Now we'll create a simple hello world app app.rb. This sets up Rackup to run the app, just like running a Sinatra app config.ru. Now we can start the server. Now we can configure the server in the Alexa Developer Portal.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              alexa-skill has a low active ecosystem.
              It has 8 star(s) with 1 fork(s). There are no watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              alexa-skill has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of alexa-skill is current.

            kandi-Quality Quality

              alexa-skill has no bugs reported.

            kandi-Security Security

              alexa-skill has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              alexa-skill does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              alexa-skill releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed alexa-skill and discovered the below as its top functions. This is intended to give you an instant insight into alexa-skill implemented functionality, and help decide if they suit your requirements.
            • Add a slot .
            • Set the card .
            • Set the response .
            • Set the utterance
            Get all kandi verified functions for this library.

            alexa-skill Key Features

            No Key Features are available at this moment for alexa-skill.

            alexa-skill Examples and Code Snippets

            No Code Snippets are available at this moment for alexa-skill.

            Community Discussions

            QUESTION

            Alexa-Skills-kit: How do a get the in-skill-products a user is entitled to outside of an alexa session
            Asked 2021-May-25 at 07:40

            I have an Alexa-Skill and am building a Web-App for this skill. In the skill users can buy a subscription for an ISP and in the Web-App I need to know if a user is subscribed (is entitled) to that ISP. How can I do that and is it even possible?

            More information
            • My skill's code (written in python using the Alexa-Skills-Kit SDK) is hosted as an AWS Lambda function.
            • The Skill's database as an AWS DynamoDB. The Web-App I'm developing has access to that DynamoDB.
            My idea What I tried so far

            First I tried invoking my skill's lambda function through the ask-sdk with a request for my skill's "getEntitledProducts" Intent. This intent stores the entitled products in the response's sessionAttributes. The request I got from the alexa developer console test tab where I (successfully) invoked the mentioned intent. Here in the developer console it works without problem

            ...

            ANSWER

            Answered 2021-May-08 at 21:24

            One possible but not the best approach can be the database solution that you suggested but with some additional data. When the user subscribes for the first time you can always save the subscription datetime in the DB and you know for how long the subscription is valid. Then you just have to play with datetime library to know wether the user is subscribed or not.

            This will not be helpful if your skill is already running and is live, but if not then this can help.

            Source https://stackoverflow.com/questions/67448022

            QUESTION

            Alexa Skill S3 missing required key Bucket in params
            Asked 2021-Apr-05 at 21:19

            I'm trying to make a skill based on Cake Time Tutorial but whenever I try to invoke my skill I'm facing an error that I don't know why.

            This is my invoking function.

            ...

            ANSWER

            Answered 2021-Apr-05 at 21:19

            instead it tries to access amazon S3 bucket for some reason

            First, your persistence adapter is loaded and configured on each use before your intent handlers' canHandle functions are polled. The persistence adapter is then used in the RequestInterceptor before any of them are polled.

            If there's a problem there, it'll break before you ever get to your LaunchRequestHandler, which is what is happening.

            Second, are you building an Alexa-hosted skill in the Alexa developer console or are you hosting your own Lambda via AWS?

            Alexa-hosted creates a number of resources for you, including an Amazon S3 bucket and an Amazon DynamoDb table, then ensures the AWS Lambda it creates for you has the necessary role settings and the right information in its environment variables.

            If you're hosting your own via AWS, your Lambda will need a role with read/write permissions on your S3 resources and you'll need to set the bucket where you're storing persistent values as an environment variable for your Lambda (or replace the process.env.S3_PERSISTENCE_BUCKET with a string containing the bucket name).

            Source https://stackoverflow.com/questions/66957985

            QUESTION

            Alexa fetching user email using python
            Asked 2021-Mar-31 at 09:04

            I am trying to make an Alexa skill using python backend. I am using amazon developer console to create model and code backend.

            I want to retrieve user email address. I would appreciate if you could provide me with sample code. I tried many methods but none were working.

            here are some codes I tried : https://github.com/alexa/alexa-skills-kit-sdk-for-python/tree/master/samples/GetDeviceAddress

            I know this is device address but this was also not working, and I thought if i could get address I can get email.

            Everything mentioned online is for Node, and I want to make my backend on python

            ...

            ANSWER

            Answered 2021-Mar-31 at 09:04

            As specified in the official documentation you need to make an API call to the ASK.

            For email you need to call your api_endpoint followed by /v2/accounts/~current/settings/Profile.email

            For me endpoint is : https://api.eu.amazonalexa.com therefore the complete url becomes : https://api.eu.amazonalexa.com/v2/accounts/~current/settings/Profile.email

            As far as adding the token to authorize the request it can be done by using the requests library by passing header to the get request. You can learn more about that from here

            The final code should then look something like this :

            Source https://stackoverflow.com/questions/66883128

            QUESTION

            Alexa Geographic location
            Asked 2021-Jan-31 at 23:49

            I am trying to get geographic location in an Alexa skill. I have enabled location services in the Alexa console and I have authorized the skill to send geographic location.

            The message I receive is the following:

            ...

            ANSWER

            Answered 2021-Jan-31 at 23:49

            You're correct on geolocation not being available for most Echo devices. Stationary devices only provide the registered address, not geographic coordinates.

            https://developer.amazon.com/en-US/docs/alexa/custom-skills/location-services-for-alexa-skills.html#device-address-as-compared-to-geo-coordinates

            You can, however use a "geocoding" service to convert most addresses to coordinates. For example Google Maps has a geocoding API.

            Source https://stackoverflow.com/questions/65933039

            QUESTION

            How to use x509 public key to verify a signed/hashed Alexa request body?
            Asked 2021-Jan-14 at 05:28

            I'm trying to work through the steps listed here for an Alexa Skill I'm developing in Java.

            I'm getting a request from Alexa which is a POST. Two of the headers are the signing certificate chain url and the signature.

            Amazon SHA1 hashes then signs the entire body of the Alexa request with an X509 key, and then base64 encodes the signed body. This is the "signature." The signing certificate chain is the url where I can GET the X509 certificate chain that contains their public key.

            What I need to do is base64 decode the signature, then use the X509 public key to decrypt the signature. This leaves me with a SHA1 hashed request body. Then I need to SHA1 hash the body of the request myself and compare the two.

            I validate the certificate chain. I extract the public key. I hash the body of the POST and produce a derived hash value (its SHA1withRSA). I base64 decode the "signature" then decrypt it with the public key to get the asserted hash value.

            I've not been able to produce a derived hash value that matches the asserted hash value. This is where I'm stuck and I can't understand what I'm doing wrong. I don't really understand this encryption stuff very well so perhaps I'm missing something super simple.

            Step 8 from the link above is where I'm stuck.

            First, I borrowed the code from the alexa SDK here. The problem is this code doesn't seem to work:

            ...

            ANSWER

            Answered 2021-Jan-14 at 05:28

            First, digital signature is NOT encryption with the privatekey; Amazon is deceiving you there, see https://security.stackexchange.com/questions/159282/can-openssl-decrypt-the-encrypted-signature-in-an-amazon-alexa-request-to-a-web which was basically the same question except without Java. And Java crypto exacerbates this because it was designed in the 1990s when this mistake was still fairly common, and as a result the Cipher object which is intended to be for encryption and decryption accepts the 'backwards' use of RSA keys and internally changes them to the operations used in the Signature scheme 'NoneWithRSA' (which might be considered a pseudo-scheme since it doesn't really match PKCS1).

            Expanding on that point, the difference between your 'decrypted' (more properly, recovered) value and a simple hash is that the PKCS1v1 signature scheme used here, now retronymed RSASSA-PKCS1-v1_5 in PKCS1v2, actually has four steps:

            #1 hash the data

            #2 encode the hash value and algorithm in a DigestInfo ASN.1 structure encoded in DER, which amounts to adding a fixed prefix per algorithm

            #3-5 prepend padding of the form 00 01 FF...(at least 8) 00

            (8.2.1#2) treating the result as a number m, apply RSASP1 which does m ^ d mod n (or for verify 8.2.2#2 apply RSAVP1 which does s ^ e mod n; this is stated as before the three padding steps above but actually can just as well be after)

            The backwards-Cipher operation performs, or reverses, only the third and fourth steps above; you have added the first step, but not the second, so your 'decrypted' value is actually a DigestInfo structure that contains some metadata, the OID for the SHA1 algorithm, and the hash value that should correspond to the data.

            This failure to create or remove the DigestInfo structure is also a very common mistake and problem; see my list at https://crypto.stackexchange.com/questions/87006/why-is-data-signed-with-sha256-rsa-pkcs-and-digest-signed-with-rsa-pkcs-differen/#87022 .

            But it doesn't match. The hash value embedded in the recovered DigestInfo is not the same as the hash value you computed on your data (and I also get). This strongly suggests some change between your data and the data the Amazon signed, but I have no idea what; certainly your data looks superficially like an Alexa request should. Sorry :-)

            Source https://stackoverflow.com/questions/65709994

            QUESTION

            Alexa skill not asking for permission (notification) when enabling the skill via voice
            Asked 2020-Sep-21 at 22:05

            The skill in question asks for one permission when enabling in Web or app (Outbound Notification). But, when implemented Skill Enabled Event it's not asking user to give notification permission or not. Skill enablement works itself but permission is by default No. How to make alexa to ask for permission when enabling via voice?

            Can Alexa prompt them via voice to enable the outbound notification?

            skill.json

            ...

            ANSWER

            Answered 2020-Sep-20 at 14:04

            There may be a different way, but once you are in the skill I believe you will need to send an ask for permissions card. As I understand it the idea is to make sure that Amazon is involved as a third party permissions granter. This will pop a permissions request in the Alexa app on the users phone. This added layer of security just makes sure the customer saw exactly what permissions they were granting.

            You can do this a few different ways in your skill. You could check the first time that the user connects and keep track of that first connection in a persistent customer data layer. Or you could just check if the user has permission when you go to use that part of the skill. If they don't respond telling the customer you sent them a card to grant permissions.

            Here is more info on permission cards: https://developer.amazon.com/en-US/docs/alexa/custom-skills/request-customer-contact-information-for-use-in-your-skill.html#permissions-card-for-requesting-customer-consent

            Source https://stackoverflow.com/questions/63978447

            QUESTION

            How to add Dynamic Entities in Alexa with Python?
            Asked 2020-May-24 at 21:56

            I am developing a Alexa Skill in Python and I need to dynamically add Entities for the user to update a Slot Type so the user can choose an option.

            I the page Use Dynamic Entities for Customized Interactions there is documentation and example for Node.js and Java, but no examples for Python. Looking at the Documentation for the Python SDK, it was not clear to me how to do the same in Python.

            I created a Slot Type called test and tried the following code:

            ...

            ANSWER

            Answered 2020-May-24 at 21:56

            QUESTION

            How do I specify which API data I want to use?
            Asked 2020-May-18 at 12:00

            I am developing an Alexa Skill (using v2 and javascript) and I'm attempting to make an API GET call to the USDA API.

            At this point I've copy/pasted from here and I'm using the USDA API example from here (with some minor changes). as an attempt just to get the connection to work and return anything that proves it worked.

            The error I currently receive is: Error handled: TypeError: Cannot read property 'generalSearchInput' of undefined at Object.handle (/var/task/index.js:39:32) at process._tickCallback (internal/process/next_tick.js:68:7)

            Directly before the error I get the return of: every entry about Cottage Cheese that is in the USDA API, I.E. WAY too much from the console.log(response). I just want the first one, or even just the name.

            Console logs have told me that I am receiving data back from the call, so I know it is working. My question is: How do I set the speechOutput to the specific piece of information I need, rather than the entire API object that is returned?

            The speechOutput that I'm looking for should say: Cottage Cheese

            The response that I am receiving is: Output from Alexa saying:

            Sorry, I had trouble doing what you asked. Please try again

            index.js

            ...

            ANSWER

            Answered 2020-May-18 at 12:00

            I figured it out. Hopefully this can help somebody who may be stuck.

            I was calling the API data incorrectly.

            The code that did what I needed

            Source https://stackoverflow.com/questions/61770245

            QUESTION

            How to construct api from json file nodejs
            Asked 2020-May-17 at 20:12

            I am trying to create API using node js from JSON file.

            I have created a simple get request from Nodejs from the JSON file, which I am trying to remove unwanted data from json file and construct new response from that json file

            My code as follows:

            ...

            ANSWER

            Answered 2020-May-17 at 20:11
            let resData = [
                {
                   "web-scraper-order": "1588668196-10",
                   "web-scraper-start-url": "https://udemycoupon.learnviral.com/coupon-category/development/page/266",
                   "pagenation": "",
                   "pagenation-href": "",
                   "courseid": "Redeem Offer",
                   "courseidhref": "https://www.udemy.com/course/amazon-alexa-101-publishing-alexa-skills-without-coding/"
                },
                {
                   "web-scraper-order": "1588668196-12",
                   "web-scraper-start-url": "https://udemycoupon.learnviral.com/coupon-category/development/page/266",
                   "pagenation": "",
                   "pagenation-href": "",
                   "courseid": "Redeem Offer",
                   "courseidhref": "https://www.udemy.com/course/learn-complete-oracle-apps-r12-technical-training/?couponCode=TTROAP"
                }
            ] ;
            
            let modifiedData = resData.map((val,ind)=>(
            {
            id : ind,
            courseidhref:val.courseidhref,
            courseTitle : val.courseidhref.split('?')[0].split('/').reverse()[1]
            }
            ));
            

            Source https://stackoverflow.com/questions/61857218

            QUESTION

            Alexa Skill with Azure AD B2C Auth expires after an hour
            Asked 2020-May-11 at 06:03

            I am currently building an Alexa skill backed by Azure Functions (.NET Core/C#) and Azure AD B2C for authentication.

            For the initial setup, I used mostly used the instructions found in this arcticle. Since, the article was written a couple of years ago, I had to make a few changes. In the end, I landed on the following configuration:

            Azure Active Directory B2C

            As I mentioned, we are using AAD B2C for authentication. Users of a related application are able to sign-up and sign-in to a React application. The idea is to provide an alternative interface for said users through Alexa intents + utterances.

            I created an application for Alexa in AAD B2C with the following settings:

            Properties Keys

            I generated a single App Key, which I'm using as the Secret in the Account Linking section in the Alexa Developer Console.

            Many of the examples online mention setting an explicit expiration date here of 1 or 2 years; however, I am not presented with any options at all (i.e. no expiration option), just the code. Could this be part of the problem???

            API Access

            For API Access, I have to API entries here:

            • One that uses the user_impersonation scope mentioned above.
            • The second, titled "Access the user's profile", uses:
              • Acquire an id_token for users (openid)
              • Acquire a refresh_token for users (offline_access)
            AAD B2C User Flow

            The user flow that I'm using allows signing up and signing in, it utilizes the following configuration:

            Properties

            Misc

            • Enable JavaScript enforcing page layout (preview): On

            Token lifetime

            • Access & ID token lifetimes (minutes): 60
            • Refresh token lifetime (days): 14
            • Refresh token sliding window lifetime: "Bounded".
            • Lifetime length (days): 90

            Token compatibility settings

            • Issuer (iss) claim: https:///
            • Subject (sub) claim: ObjectID
            • Claim representing user flow: tfp

            Session behavior

            • Web app session lifetime (minutes): 1440
            • Web app session timeout: Rolling
            • Single sign-on configuration: Tenant
            • Require ID Token in logout requests: No
            Azure Function Authentication Middleware

            For the authentication layer within the Azure Function, I'm utilizing the method described in the article mentioned above.

            Alexa Developer Console

            On the Alexa side of things, I have a really simple skill setup with the following settings:

            Endpoint

            My endpoint uses the HTTPS option with the default region set to the fully-qualified HTTPS endpoint of my Azure Function App's handler function.

            The certificate set to "My development endpoint is a sub-domain of a domain that has a wildcard ..."

            Account Linking

            The account linking settings are as outlined below:

            • Do you allow uses to create an account or link to ...: Toggled On
            • Allow users to enable skill without account linking: Toggled On
            • Allow users to link their account to your skill from within your application or website: Toggled Off
            • Auth Code Grant: On
            • Authorization URI: https://myorg.b2clogin.com/myorg.onmicrosoft.com/oauth2/v2.0/authorize?p=
            • Access Token URI: https://myorg.b2clogin.com/myorg.onmicrosoft.com/oauth2/v2.0/token?p=
            • Your Client ID: AAD B2C App GUID
            • Your Secret: Key generated in App settings in AAD B2C for my Alexa Skill App (mentioned in the AAD B2C setup info above).
            • Your Authentication Scheme: HTTP Basic
            • Scope: openid and https://myorg.onmicrosoft.com/alexa/user_impersonation
            • Domain List: login.microsoftonline.com and myorg.b2clogin.com Note: This is probably wrong as I didn't know what to put here. The article above doesn't mention this setting at all
            • Default Access Token Expiration Time: 3600

            Note: The Alexa Redirect URLS at the bottom are what I put in AAD B2C for the Reply URL section.

            The Problem

            Now for the most important part, The Problem. Everything seems to work at first...I'm able to go to alexa.amazon.com and utilize Link Account (which redirects me to and from my AAD B2C-driven login screen). Once I link accounts, I'm able to successfully utilize an utterance and receive a reply.

            The problems starts when I wait an hour (I believe it's an hour). Attempting to initiate the Intent after an hour yields an error on the Azure Function app side of things when it tries to validate the Auth Token.

            Can anyone provide me some guidance as to what I may have setup incorrectly or at least some things that I should look into? As I mentioned at the start of this question, many of the references that I'm finding online are out-of-date and do not cover all of the settings that I'm expected to utilize. Many of them are still using microsoftonline.com authority vs. b2clogin.com.

            At a glance, I would assume that the problem is that the Alexa skill is failing to refresh its token after it expires after an hour. What do I need to do to ensure that it refreshes correctly?

            ...

            ANSWER

            Answered 2020-Mar-21 at 16:20

            I think that I have enough information at this point to go ahead and answer my own question. What I found was that the offline_access scope is necessary for Token Refresh to be possible.

            Per Microsoft, "The offline_access scope gives your app access to resources on behalf of the user for an extended time. On the consent page, this scope appears as the "Maintain access to data you have given it access to" permission. When a user approves the offline_access scope, your app can receive refresh tokens from the Microsoft identity platform token endpoint. Refresh tokens are long-lived. Your app can get new access tokens as older ones expire.".

            You can read more about it here.

            To resolve the issue, I ensured that this scope was available in AAD B2C and added it as a referenced scope in the Alexa developer console.

            Source https://stackoverflow.com/questions/60716091

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install alexa-skill

            You can download it from GitHub.
            On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/skierkowski/alexa-skill.git

          • CLI

            gh repo clone skierkowski/alexa-skill

          • sshUrl

            git@github.com:skierkowski/alexa-skill.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link