DEV Community

loading...

How to send JSON response to AWS Alexa skill from JAVA

muTheTechie
Loving #opensource #AWS #python
・1 min read


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);
Enter fullscreen mode Exit fullscreen mode

Discussion (0)