Skip to content

Instantly share code, notes, and snippets.

@morishin
Last active January 9, 2017 04:03
Show Gist options
  • Save morishin/88042177ffdbbdb3349b0530a9de5d1f to your computer and use it in GitHub Desktop.
Save morishin/88042177ffdbbdb3349b0530a9de5d1f to your computer and use it in GitHub Desktop.

Slack Slash Command

API Gateway

Body Mapping Template for API Gateway (Slack Slash Command -> Lambda)

Slack Slash Command (application/x-www-form-urlencoded) -> API Gateway -> Lambda (application/json)

2017-01-09 12 27 45

#set($httpPost = $input.path('$').split("&"))
{
#foreach( $keyValue in $httpPost )
 #set($data = $keyValue.split("="))
 "$data[0]" : "$data[1]"#if( $foreach.hasNext ),#end
#end
}

AWS Lambda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment