Alexa should ask for use strict';
const Alexa = require('alexa-sdk');
exports.handler = (event, context) => {
const alexa = Alexa.handler(event, context);
var APP_ID = "amzn1.ask.skill.[XXXXX-45cc-9558-3c284b72148f]";
alexa.APP_ID = APP_ID;
alexa.dynamoDBTableName = 'LongFormAudioSample'; // creates new table for session.attributes
alexa.registerHandlers(handlers);
alexa.execute();
};
const handlers = {
'LaunchRequest': function() {
},
'NewSession': function() {
this.attributes['eventType'] = "";
},
'SessionEndedRequest': function() {
//this.attributesp["crash:emergency"] = null;
this.emit(':tell', "Thank you");
},
'WishingWelcomeIntent': function( ) {
// here I want to send username
var username = ''; // should get from request
var json = {
place : "USA";
}
// this.emit(":tell", "Hi", +username, "you'r welcome", json should
send along with the audio response from Alexa );
},
};
Как мы можем отправлять данные в Alexa? POST данные Alexa в приложение.
На самом деле я хочу отправить данные в лямбда-функцию вместе со звуком.
Я хочу отправить некоторые данные JSON из Alexa в свое приложение.
Разрабатываю мобильное приложение. с голосовой службой Alexa.
Есть ли способ отправлять и получать данные с помощью Alexa?