-
-
Notifications
You must be signed in to change notification settings - Fork 191
Alexa Receiver node
Open the Alexa Developer Console and create a new skill:
Be sure to select the custom model and Start from scracth in the following step.
Then you have to pickup the invocation name, it the name of your chatbot that will answer to sentences like "Alexa, ask my-chatbot-name to ...".
Alexa needs a callback to send the requests to: it must be a https endpoint (a self signed certificate it's not enough). For testing we'll use ngrok to create a https tunnel for our local Node-RED instance. Install it, then open a shell window and run
ngrok http 127.0.0.1:1880
You should get something like
Grab the https address you get, something like https://123123.ngrok.io, this is the base url that points back to your Node-RED instance.
The callback is
http://youraddress.ngrok.io/redbot/alexa
This callback should fill the field Default region in the Endpoint session
We're ready to create the first simple flow:
Note: the Alexa Receiver
node configuration doesn't need any particular configuration (no tokens or secret key like other chatbots), for testing the default one is ok.
Now switch to the test page from the menu and type
start my-chatbot-name
you should hear the answer defined in the Speech node and see in the console the events of type start
Important: Alexa chatbots works differently compared to other chatbot APIs like Telegram or Facebook: calls are synchronous, when Alexa calls the RedBot's endpoint it expects an immediate response. Internally RedBot will store the response object in the Node-RED message and will use it in the final Alexa Sender node
.
For this reason the flow (nodes between the receiver to the sender nodes) cannot last more than the Alexa timeout (3000 ms).