How to send JSON response to AWS Alexa skill from JAVA



JSONObject outputSpeechContent = new JSONObject();
outputSpeechContent.put("type", "PlainText");
outputSpeechContent.put("text", engineResponse.getText());
JSONObject outputSpeech = new JSONObject();
outputSpeech.put("outputSpeech", outputSpeechContent);

JSONObject resObj = new JSONObject();
resObj.put("version", "1.01");
resObj.put("response", outputSpeech);
response.setStatusCode(200);
Did you find this post useful? Show some love!
Classic DEV Post from Aug 28 '17

JavaScript project ideas and practical uses

Perfect for when you know JS but can't think of what to build

READ POST
Follow @yaphi1 to see more of their posts in your feed.
#Muthupandian (mu)
Member since Feb 4, 2017
More from @mu
Programmatically check table exist in AWS Dynamo DB from Lambda function
#serverless #java
Trending on dev.to
Playing With Apache Storm On Docker - Like A Boss
#storm #java #docker #data
JVM Primer Part 2 - Debugging memory issues
#java #devops #kotlin #programming
A Primer on JVM Memory Management and Troubleshooting - 1
#java #jvm #kotlin #programming
Startup CliX: RC1 with Private Games & Mobile UI
#pushercontest #javascript #game #aws
Hi, I'm Kyle. I just wrote a book on learning AWS, I love helping others and working on side projects. AMA!
#ama #aws
Startup CliX: Finally some Gameplay
#pushercontest #aws #javascript #game
Java Enterprise 101: Building a REST Server with Spring Boot
#java #rest #spring #jee