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 람다 노드 JS에서 수신 및 수신 데이터를 보내려합니다.
사실 나는 오디오와 함께 람다 함수에 데이터를 보내려고합니다.
알렉사에서 일부 응용 프로그램으로 JSON 데이터를 보내고 싶습니다.
모바일 앱을 개발 중입니다. 알렉사 음성 서비스.
Alexa를 사용하여 데이터를 보내고받을 수있는 방법이 있습니까?
'name'= "Alexa"키를 요청과 함께 보내려는 경우 js 노드에서이 키를 읽으 려합니다. – Dev
Alexa 서비스는 [특정 형식] (https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#request-format)으로 람다 함수에 게시물을 보냅니다. API 게이트웨이 엔드 포인트에 게시 할 때도 사용할 것입니다. 그런 식으로 요청에서'attributes' 노드를 사용하여 원하는 키/값 쌍을 전달할 수 있습니다. –