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
2
Answers
Found a solution to use mapping response templates
The quickest way to implement this is to use a custom ResponseTemplate in API Gateway Integration response. Something like this.
Also don’t forget to re-deploy the API Gateway after updating the ResponseTemplate mapping.