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 );
},
};
How can we send data to Alexa? POST data Alexa to the app.
Actually, I want to send data to the lambda function along with the audio.
I want to send some JSON data from Alexa to my application.
I am developing the mobile app. with Alexa voice service.
Is there any way to send and receive data using Alexa?