amazon-web-servicesaws-api-gatewayamazon-sqs

Customize response from AWS API Gateway integrated to SQS


I have integrated AWS API Gateway to SQS queue and it give response in format

{
"SendMessageResponse": {
    "ResponseMetadata": {
        "RequestId": "acfa1737-7d53-5aeb-8c75-482a8f8eab1b"
    },
    "SendMessageResult": {
        "MD5OfMessageAttributes": null,
        "MD5OfMessageBody": "ed1dbe6fa17bf45a3d20ea7be2661bfb",
        "MD5OfMessageSystemAttributes": null,
        "MessageId": "e41f656e-1e2a-4269-a0e0-2016d9406ac8",
        "SequenceNumber": null
    }
}

}

how can I customize the integraion that response will look like

{           
   "RequestId": "e41f656e-1e2a-4269-a0e0-2016d9406ac8",
   "Message": "Request Accepted"
}

where RequestId is MessageId from SQS Queue and the Message is some custom acknowledgment message


Solution

  • Found a solution to use mapping response templates

    enter image description here