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);
Did you find this post useful? Show some love!
Classic DEV Post from Mar 31

When did you stop thinking of yourself as a junior/newbie?


Living at Whirldata

Do you write code almost every day?

Join ❀️