I'd developing a custom Slack command returning response from an Amazon lambda via API Gateway. Everything was working well when suddenly I couldn't make any call without returning
'Darn - that slash command didn't work (error message: `500_service_error`
Via Curl, the response status is '200' and I'm still receiving correctly the json response of my lambda.
Thanks
I've discussed with the Slack team that can check their internal logs for you:
"Unfortunately we don't have a debug console available for developers just yet"
"I can confirm that Slack is receiving a 500 server error when connecting to your Slash command endpoint. Unfortunately I don't really have any more information from our end"
The real problem is the transformation of the call body from form to json at the level of the API Gateway. Slack is sending a form body that has to be transformed in json for the lamda. I was following this thread https://forums.aws.amazon.com/thread.jspa?messageID=673012&tstart=0#673012:
It will be nice in future to have the logs of the Slack features, to have JSON payload instead of form and in the same time to enable directly the Cloudwatch logs for API Gateway in order to check random bugs :)
Thanks