question

shanthi avatar image
shanthi asked

ALEXA send response asynchronously through EVENTS gateway

I have followed all steps mentioned here https://developer.amazon.com/en-US/docs/alexa/smarthome/send-events-to-the-alexa-event-gateway.html till retrieving the bearer token. But I would like to know exactly how do we send a asynchronous response to Alexa? If you see the example here


POST /v3/events HTTP/1.1
Host: api.amazonalexa.com
Authorization: Bearer access-token-from-Amazon
Content-Type: application/json

{
  "context": {
    "properties": [
    ]
  },
  "event": {
    "header": {
      "messageId": "abc-123-def-456",
      "correlationToken": "abcdef-123456",
      "namespace": "Alexa",
      "name": "Response",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "access-token-from-Amazon"
       },
       "endpointId" :  "endpoint-id"
    },
    "payload": {
    }
  }
}

There is a mention of endpoint-id? What is the endpoint-id for the alexa device itself? How can I send a response to alexa? I just want to send a "hello world" response which alexa will voice it out when I send it through an events gateway? Can anyone show me a sample? Thanks


The flow I will be using is


Alexa calls aws lambda


Lambda sends a deferred response synchronously


Then after some time I would like to send a response message to alexa asynchronously


But all the example codes I have seen mention an endpointid. I am not sure what it is? I just want to send a simple response which alexa needs to voice it out. That's all Is it possible at all? THANKS



alexa skills kitalexa voice servicealexaalexa dev daysalexa skills challenge
1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Can anyone help me? Can you please post an example of a simple async Response to ALexa through the event gateway, all alexa has to do is voice out the response that's it.Many Thanks Please note I have reached till the part where Bearer token is received successfully and then access and refresh tokens too all are good.
0 Likes 0 ·

0 Answers