alexa

Returning handler.ResponseBuilder from promise.then() method

空扰寡人 提交于 2019-12-05 19:02:38
In one of the intent handler for my Alexa skill I have to return response once my promise is resolved. Code looks like this : var rcvPromise = receiveMsgQ(); rcvPromise.then(function(speechText) { console.log('rcv Promise resolved with ',speechText); return handlerInput.responseBuilder .speak(speechText) .withSimpleCard('skill_name', speechText) .withShouldEndSession(false) .getResponse(); }); Skill returns with ERROR message with no additional details about error. Is there any way to fix this problem? PS: I need to use promise as receiveMsgQ() is asynchronous function call. The error you're

AudioPlayer “PlaybackNearlyFinished” Request of Alexa Skills Kit, Not Working

瘦欲@ 提交于 2019-12-05 18:46:50
I've written an Alexa Skill that uses a Lambda Function to play unique audio from a given URL. The Intent called "PlayAudio" is working and plays the first audio item from our JSON-formatted API. The Intent called "PlaybackNearlyFinished" does not work, aka, does not play the audio file I am feeding it. Can anybody crack exactly why this doesn't work? Here is a section from my Lambda Function, which contains the two Intents: Fact.prototype.intentHandlers = { "PlayAudio": function (event, context, response) { fetchEnseParse("/latest", function(body) { if(body == "error") { } else { var

How to get an Alexa userId?

房东的猫 提交于 2019-12-05 13:11:54
问题 I'm building an Alexa Skill, and it requires that I store the userId of a user. I've tried to retrieve it with event.session.user.userId . However, when I call console.log(event.session.user.userId) the output is literally amzn1.ask.account.[unique-value-here] . I've looked at several similar questions, and none of them provide a clear enough answer for me. I'm not sure if this is a bug, a developer-only thing, or if the userId is simply anonymized. If so, is there a way to get the actual

ASK CLI to deploy to different environments?

笑着哭i 提交于 2019-12-05 12:14:13
Is it possible to use Alexa Skill Kit's ASK CLI deploy command to build, for example, a debug version of the app that deploys a development environment and a release version of the app that deploys to a test environment? My team and I are trying to deploy the same skill to two different environments, so our testing team can do their thing in the test environments and development can do their thing in the development environment. This will be a private skill so using http://developer.amazon.com separation of test and "prod" via publishing the application is not an option. There are probably a

Possible to get alexa information or google page rankings over time?

两盒软妹~` 提交于 2019-12-05 07:21:57
问题 I am trying to access historical google page rankings or alexa rankings over time to add some weightings on a search engine I am making for fun. This would be a separate function that I would call in Python (ideally) and pass in the paramaters of the URL and how long I wanted to get the average over, measured in days and then I could just use that information to weight my results! I think it could be fun to work on, but I also feel that this may be easy to do with some trick of the APIs some

Alexa Skill Development using flask-ask and ngrok

烈酒焚心 提交于 2019-12-04 19:17:34
问题 I'm trying to begin developing a skill for alexa using flask-ask and ngrok in python. Following is my code: from flask import Flask from flask_ask import Ask, statement, question, session import json import requests import time import unidecode app = Flask(__name__) ask = Ask(app, "/reddit_reader") def get_headlines(): titles = 'is this working' return titles @app.route('/') def homepage(): return "hi there, how ya doin?" @ask.launch def start_skill(): welcome_message = 'Hello there, would

Issue decrypting Alexa request signature using openssl_public_decrypt

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 18:42:33
I'm implementing a validator for validating incoming requests from Amazon Alexa . I'm on step 5 and 6 which state: 5) base64-decode the Signature header value on the request to obtain the encrypted signature. 6) Use the public key extracted from the signing certificate to decrypt the encrypted signature to produce the asserted hash value. I've managed to extract the public key from the PEM-encoded X.509 certificate by doing: $publicKey = openssl_pkey_get_public($pem); $keyData = openssl_pkey_get_details($publicKey); Which returns my public key. I've then attempted to decrypt the signature like

How to call a SSL secured REST service within AWS Lambda

我怕爱的太早我们不能终老 提交于 2019-12-04 14:48:08
问题 Is it possible to do an REST call to https://owapi.net/api/v3/u/<Playername>-<BattleTagNumber>/stats via the JAX RS REST client withi AWS Lambda and if so, what do I have to set up with the Java SSL? Currently I do the following: System.setProperty("javax.net.debug", "all"); SSLContext sc = SSLContext.getInstance("TLSv1.2"); System.setProperty("https.protocols", "TLSv1.2");//Java 8 TrustManager[] trustAllCerts = { new InsecureTrustManager() }; sc.init(null, trustAllCerts, new java.security

How to handle synonyms in intents in Alexa?

核能气质少年 提交于 2019-12-04 14:36:00
In the following example: If the user says toffee, shouldn't that be translated to candy? I ask because the value handed to my intent is 'toffee'. So not sure what I have incorrect. types":[ { "name":"SHOPPING_LIST", "values":[ { "id":null, "name":{ "value":"candy", "synonyms":[ "toffee" ] } }, { "name":"GetPrice", "samples":[ "Get me the price of {item}", "tell me the price of {item}", ], "slots":[ { "name":"item", "type":"SHOPPING_LIST" } ] } We need to handle the entity resolution in your backend code. More can be referred here: https://developer.amazon.com/blogs/alexa/post/5de2b24d-d932

How to store the data for the Alexa skill I am developing?

不想你离开。 提交于 2019-12-04 07:30:32
I am currently developing an Alexa skill based on health care. So I need to store information about diseases, their diagnosis and symptoms. I have made a basic skill including information about one disease in a file, made a zip file, uploaded it to AWS Lambda and got certified by Amazon. Now I need to make this more extensive where I need to have information about many diseases. Where can I store this huge data and how to retrieve it from my Lambda function? If using DynamoDB is the right way, then how to retrieve data from there from my Lambda function? Or Is there any other better way? You