jeudi 30 juillet 2015

AWS lambda send response to API gateway

I have a lambda function that generates some text. This is for a simple Twilio app

<Say>Welcome to your conference room!</Say>
<Dial>
   <Conference beep="true">waitingRoom</Conference>
</Dial>

When I make a POST request using postman it outputs exactly that. but I have two problems:

  1. The headers comes back at application/json, and I need it as text/xml.
  2. When I make the POST request from Twilio I get 502 Bad Gateway

I know it has to do something with the incoming params mapping and also mapping the response from Lambda back to the API Gateway as text/xml. But I can;t figure out how to do this.

enter image description hereenter image description here




Aucun commentaire:

Enregistrer un commentaire