{"id":3703,"date":"2016-10-07T20:18:18","date_gmt":"2016-10-07T11:18:18","guid":{"rendered":"https:\/\/www.jaswill.co.jp\/blog\/?p=3703"},"modified":"2018-07-27T13:50:01","modified_gmt":"2018-07-27T04:50:01","slug":"post-3703","status":"publish","type":"post","link":"https:\/\/www.jaswill.co.jp\/blog\/2016\/10\/07\/post-3703\/","title":{"rendered":"AWS \u300cAPIGateway\u300d\u3068\u300cLambda\u300d\u3067\u30b5\u30fc\u30d0\u30ec\u30b9\u300cslack bot\u300d\u3092\u4f5c\u308b"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001<\/p>\n<p>\u300c\u6c7a\u6226\u306f\u91d1\u66dc\u65e5\u300d\u3001\u3001\u3001\u3067\u306f\u306a\u304f\u3001<\/p>\n<p>\u300c\u65e5\u66dc\u65e5\u306f\u30d7\u30ec\u30bc\u30f3\u300d\u306a\u3001\u30e4\u30de\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u30bf\u30a4\u30c8\u30eb\u901a\u308a\u3001<\/p>\n<p>&nbsp;<\/p>\n<p>AWS\u306e\u300cAPI Gateway\u300d\u3068\u300cLambda\u300d\u3092\u4f7f\u3063\u3066\u3001\u793e\u5185\u5c02\u7528\u306e\u300cslack bot\u300d\u3092<\/p>\n<p>\u4f5c\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3063\u3066\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span class=\"markerYellow\"><span style=\"font-size: 24pt;\">\u30b5\u30fc\u30d0\u30ec\u30b9<\/span>\u3067\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u3059\u3079\u3066\u306e\u624b\u9806\u3092\u66f8\u304f\u3068\u3001\u3082\u306e\u3059\u3054\u304f\u9762\u5012\u306a\u306e\u3067\u3001\u3044\u3064\u3082\u306e\u3088\u3046\u306b\u6982\u8981\u3060\u3051\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u30cf\u30b7\u30e7\u30ea\u30de\u30b9\u3002<\/p>\n<p>slack\u306f\u65e2\u306b\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u304a\u6301\u3061\u3068\u3044\u3046\u524d\u63d0\u3067\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u51e6\u7406\u306e\u5168\u4f53\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<div class=\"pointBox\">slack\u3078\u6295\u7a3f\u3000\u21d2\u3000Outgoing Webhook(slack)\u3000\u21d2\u3000API Gateway(AWS)\u3000\u21d2\u3000Lambda(AWS)\u3000\u21d2\u3000Incoming Webhook(slack)\u3000\u21d2\u3000\u30dc\u30c3\u30c8\u304b\u3089\u306e\u8fd4\u7b54\u304c\u8868\u793a\u3055\u308c\u308b<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>\u4ee5\u4e0b\u3001\u4f5c\u6210\u624b\u9806<\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"outline__1\">\uff11\uff09Outgoing Webhook\u3000\u3092\u767b\u9332\u3057\u307e\u3059<\/h2>\n<p>\u3000Outgoing Webhook\u306b\u306f\u3001\u30dc\u30c3\u30c8\u3092\u547c\u3073\u51fa\u3059\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u300cTrigger Words\u300d\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3000API Gateway\u3092\u547c\u3073\u51fa\u3059\u305f\u3081\u306eURL\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\uff08\u5f8c\u304b\u3089\u4f5c\u308bAPI Gateway\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8URL\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\uff09<\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"outline__2\">\uff12\uff09Incoming Webhook\u3000\u3092\u767b\u9332\u3057\u307e\u3059<\/h2>\n<p>\u3000Incoming Webhook\u3067\u306f\u3001Lambda(AWS)\u304b\u3089\u6295\u7a3f\u3059\u308b\u305f\u3081\u306eURL\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u306e\u3067\u3001<\/p>\n<p>\u3000\u4f5c\u3063\u3066\u63a7\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"outline__3\">\uff13\uff09Lambda\u3092\u4f5c\u6210\u3057\u307e\u3059<\/h2>\n<p>\u3000node.js\u3092\u89e6\u3063\u305f\u4e8b\u304c\u306a\u3044\u306e\u3067\u3001\u3053\u3053\u306f\u4e0b\u8a18\u306e\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u3055\u305b\u3066\u9802\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3000http:\/\/qiita.com\/tmtysk\/items\/7161b11e20ac5e2dfc01<\/p>\n<p>\u3000\u6295\u7a3f\u5148\u306f\u3001slack\u306eIncomingWebhook\u3067\u751f\u6210\u3055\u308c\u305fURL\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"outline__4\">\uff14\uff09API Gateway\u3092\u767b\u9332\u3057\u307e\u3059<\/h2>\n<p>\u3000\u300cAPI\u3092\u4f5c\u6210\u300d\u304b\u3089\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u3000POST\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u6210\u3057\u3001\u300c\u30e1\u30bd\u30c3\u30c9\u30ea\u30af\u30a8\u30b9\u30c8\u300d\u5185\u306e\u300cURL\u30af\u30a8\u30ea\u6587\u5b57\u5217\u30d1\u30e9\u30e1\u30fc\u30bf\u300d\u306b\u3001<\/p>\n<p>\u3000OutgoingWebhook\u3067\u6e21\u3055\u308c\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u7fa4\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3000\u8a73\u3057\u304f\u306f\u3001OutgoingWebhook\u753b\u9762\u5185\u306b\u3042\u308b\u300cOutgoing Payload and Responses\u300d\u3092expand\u3059\u308b\u3068<\/p>\n<p>\u3000\u8868\u793a\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u305d\u3061\u3089\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u7d9a\u3044\u3066\u3001\u300c\u7d71\u5408\u30ea\u30af\u30a8\u30b9\u30c8\u300d\u5185\u306b\u3042\u308b\u3001\u672c\u6587\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30de\u30c3\u30d4\u30f3\u30b0\u3092\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n<p>\u3000slack\u304b\u3089POST\u3055\u308c\u308b\u300cx-www-form-urlencoded\u300d\u3092\u3001Lambda\u3067\u51e6\u7406\u3059\u308b\u300cJSON\u300d\u3078\u30de\u30c3\u30d4\u30f3\u30b0\u3059\u308b\u305f\u3081\u306e\u51e6\u7406\u3067\u3059\u3002<\/p>\n<p>\u3000\u3053\u3061\u3089\u306e\u8a18\u4e8b\u304c\u53c2\u8003\u306b\u306a\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u3000<a href=\"http:\/\/tech.feedforce.jp\/aws-lambda.html\">http:\/\/tech.feedforce.jp\/aws-lambda.html<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u6700\u5f8c\u306b\u3001\u30c7\u30d7\u30ed\u30a4\u3057\u3066\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8URL\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u306e\u3067\u3001OutgoingWebhook\u306eURL\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u3048\u3089\u3044\u30cf\u30b7\u30e7\u30c3\u30c6\u3057\u307e\u3044\u307e\u3057\u305f\u3002\u3002\u3002(\u30fb\u03c9\u30fb;)<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>slack\u306b\u5bfe\u3057\u3066\u3001\u7279\u5b9a\u306e\u6587\u5b57\u5217\u3092\u6295\u7a3f\u3059\u308b\u3068\u3001OutgoingWebhook(slack)\u304c\u53cd\u5fdc\u3057\u3066\u3001APIGateway(AWS)\u3092\u547c\u3073\u51fa\u3057\u3001<\/p>\n<p>APIGateway(AWS)\u306fOutgoingWebhook(slack)\u3067POST\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092\u3046\u307e\u3044\u3053\u3068\u3001JSON\u306b\u5909\u63db\u3057\u3066\u3001Lambda(AWS)\u3078\u6e21\u3057\u307e\u3059\u3002<\/p>\n<p>Lambda(AWS)\u3067\u30c7\u30fc\u30bf\u3092\u53d7\u3051\u53d6\u308a\u3001\u597d\u304d\u306a\u3088\u3046\u306b\u51e6\u7406\u3057\u305f\u3042\u3068\u3001<\/p>\n<p>IncomingWebhook(slack)\u306b\u5bfe\u3057\u3066\u6295\u7a3f\u3059\u308c\u3070\u3001\u30dc\u30c3\u30c8\u304b\u3089slack\u3078\u81ea\u52d5\u7684\u306b\u6295\u7a3f\u3055\u308c\u308b\u3001<\/p>\n<p>\u3068\u3044\u3046\u4ed5\u7d44\u307f\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>Lambda\u306e\u88cf\u3067\u306f\u3001node.js\u304c\u52d5\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Java8\u3084Python\u3082\u52d5\u304d\u307e\u3059\u306e\u3067\u3001<\/p>\n<p>\u5b8c\u5168\u306b\u30b5\u30fc\u30d0\u30ec\u30b9\u306aWEB\u30a2\u30d7\u30ea\u304c\u4f5c\u308c\u3061\u3083\u3044\u307e\u3059\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u3055\u3089\u306b\u305d\u306e\u88cf\u3067\u306fDB\u30b5\u30fc\u30d3\u30b9\u3068\u306e\u9023\u643a\u3082\u3067\u304d\u307e\u3059\uff08\u305f\u3076\u3093\u3002\u3002\u3002\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>Lambda\u3067\u306f\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u56de\u6570\u3068\u3001\u5b9f\u884c\u6642\u9593\u3001\u51e6\u7406\u306b\u5272\u308a\u5f53\u3066\u308b\u30e1\u30e2\u30ea\u306b\u3088\u3063\u3066<\/p>\n<p>\u6599\u91d1\u304c\u5909\u308f\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u308f\u3056\u308f\u3056\u30b5\u30fc\u30d0\u3092\u7acb\u3066\u305a\u3001\u304a\u624b\u8efd\u306b\u9023\u643a\u30a2\u30d7\u30ea\u3092\u4f5c\u308b\u306a\u3089\u3001\u9078\u629e\u80a2\u306e\u4e00\u3064\u3068\u3057\u3066\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3061\u306a\u307f\u306b\u4eca\u56de\u306f\u3001AWS\u306e\u8272\u3093\u306a\u30b5\u30fc\u30d3\u30b9\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u3001<\/p>\n<p>\u52c9\u5f37\u3082\u517c\u306d\u3066\u4f5c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u9593\u9055\u3044\u306a\u3069\u3042\u308a\u307e\u3057\u305f\u3089\u3001\u305c\u3072\u3054\u6307\u6458\u304f\u3060\u3055\u3044\uff01<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001 \u300c\u6c7a\u6226\u306f\u91d1\u66dc\u65e5\u300d\u3001\u3001\u3001\u3067\u306f\u306a\u304f\u3001 \u300c\u65e5\u66dc\u65e5\u306f\u30d7\u30ec\u30bc\u30f3\u300d\u306a\u3001\u30e4\u30de\u3067\u3059\u3002 &nbsp; \u30bf\u30a4\u30c8\u30eb\u901a\u308a\u3001 &nbsp; AWS\u306e\u300cAPI Gateway\u300d\u3068\u300cLambda\u300d\u3092\u4f7f\u3063\u3066\u3001\u793e\u5185\u5c02\u7528\u306e\u300cslack bot\u300d\u3092 \u4f5c\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3063\u3066\u307e\u3059\u3002 &nbsp; \u30b5\u30fc\u30d0\u30ec\u30b9\u3067\u3002 &nbsp; &#038; [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":6597,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[382,424,425,426,427,428,429],"class_list":["post-3703","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web","tag-aws","tag-lambda","tag-api-gateway","tag-slack-bot","tag-slack","tag-outgoing-webhook","tag-incoming-webhook"],"views":11,"_links":{"self":[{"href":"https:\/\/www.jaswill.co.jp\/blog\/wp-json\/wp\/v2\/posts\/3703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jaswill.co.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jaswill.co.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jaswill.co.jp\/blog\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jaswill.co.jp\/blog\/wp-json\/wp\/v2\/comments?post=3703"}],"version-history":[{"count":3,"href":"https:\/\/www.jaswill.co.jp\/blog\/wp-json\/wp\/v2\/posts\/3703\/revisions"}],"predecessor-version":[{"id":6598,"href":"https:\/\/www.jaswill.co.jp\/blog\/wp-json\/wp\/v2\/posts\/3703\/revisions\/6598"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.jaswill.co.jp\/blog\/wp-json\/wp\/v2\/media\/6597"}],"wp:attachment":[{"href":"https:\/\/www.jaswill.co.jp\/blog\/wp-json\/wp\/v2\/media?parent=3703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jaswill.co.jp\/blog\/wp-json\/wp\/v2\/categories?post=3703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jaswill.co.jp\/blog\/wp-json\/wp\/v2\/tags?post=3703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}