1
votes

The diagram is :

Slack channel outgoing webhook ---POST---> API gateway ---trigger---> Lambda, then

Lambda ---return---> API gateway ---return---> Slack channel

The first part is working as I can see the logs from CloudWatch with correct response data.

The issue is that slack channel doesn't get any response data. According to https://api.slack.com/custom-integrations/outgoing-webhooks, the outgoing hook responding has to be in the following JSON should be returned as the body of the response: { "text": "MYRESPONSE DATA" }

I edit api gateway integration response as the picture below: enter image description here

And my lambda function return response data as the picture below:

enter image description here

'Good day!' is my response data.

Anyone could help or suggest how can I debug?

Thanks in advance.

1

1 Answers

0
votes

You should be adding quotes to the output to form valid json.

 {
    "test" : "$input.path('$')"
 }

If you want to return a stringified json in "test", try

 {
    "test" : "$util.escapeJavaScript($input.path('$')"
 }