Last active
June 19, 2018 07:44
-
-
Save standemchuk/7f472760532c3d12fd6a4f9a81d879ac to your computer and use it in GitHub Desktop.
Example intent handler of Amazon Alexa request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async handle(handlerInput) { | |
const slotValue = handlerInput.requestEnvelope.request.intent.slots['requestReason'].value; | |
const response = await axios.post('https://google.com', { | |
"Param1": slotValue | |
}); | |
if (response && response.status === 200) { | |
return handlerInput.responseBuilder | |
.speak('Ok, I\'ve notified the staff about your request') | |
.getResponse(); | |
} else { | |
return handlerInput.responseBuilder | |
.speak('There was a problem with notifying the staff') | |
.getResponse(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment