{"id":436,"date":"2016-04-25T04:01:00","date_gmt":"2016-04-24T19:01:00","guid":{"rendered":"http:\/\/www.cotegg.com\/blog\/?p=436"},"modified":"2016-06-26T11:52:49","modified_gmt":"2016-06-26T02:52:49","slug":"line-bot%e3%82%92%e8%a9%a6%e3%81%97%e3%81%a6%e3%81%bf%e3%81%be%e3%81%97%e3%81%9f%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.cotegg.com\/blog\/?p=436","title":{"rendered":"LINE BOT\u3092\u7121\u6599\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002heroku + Rails"},"content":{"rendered":"<p>\u3053\u3093\u3070\u3093\u306f<\/p>\n<p>\u305f\u307e\u306b\u306f\u30a8\u30f3\u30b8\u30cb\u30a2\u3063\u307d\u3044\u3068\u3053\u308d\u3092\u898b\u305b\u3088\u3046\u3068\u601d\u3044\u3001\u9045\u308c\u3070\u305b\u306a\u304c\u3089\u3001\u6d41\u884c\u308a\u306eLINE BOT\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u56de\u4f5c\u3063\u305fBOT\u306e\u8fd4\u7b54\u306e\u30ed\u30b8\u30c3\u30af\u306f\u3044\u305f\u3063\u3066\u30b7\u30f3\u30d7\u30eb\u3002<\/p>\n<p>\u4f1a\u793e\u540d\u306e\u7531\u6765\u3067\u3042\u308b\u300c\u30bf\u30de\u30b4\u304c\u5148\u304b\u3001\u30cb\u30ef\u30c8\u30ea\u304c\u5148\u304b\u300d\u3068\u3044\u3046\u8a00\u8449\u306b\u3061\u306a\u307f\u3001\u300c(\u524d\u306e\u4eba\u304c\u8a71\u3057\u305f\u8a00\u8449)\u304c\u5148\u304b\u3001(\u9001\u3063\u305f\u30e1\u30c3\u30bb\u30fc\u30b8)\u304c\u5148\u304b\u300d\u3068\u3044\u3046\u8a00\u8449\u3092BOT\u304c\u8fd4\u3059\u3082\u306e\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>(\u4f1a\u793e\u540d\u306e\u7531\u6765\u306f<a href=\"http:\/\/www.cotegg.com\/blog\/?p=216\">\u30c9\u30ea\u30eb\u3092\u8cb7\u3046\u4eba\u306f\u30c9\u30ea\u30eb\u304c\u6b32\u3057\u3044\u3002<\/a>\u3092\u53c2\u7167)<\/p>\n<p>LINE BOT\u306e\u4ed5\u7d44\u307f\u3068\u3057\u3066\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/bot_img001.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/bot_img001.png\" alt=\"bot_img001\" width=\"740\" height=\"307\" class=\"alignnone size-full wp-image-437\" srcset=\"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/bot_img001.png 740w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/bot_img001-300x124.png 300w\" sizes=\"(max-width: 740px) 100vw, 740px\" \/><\/a><\/p>\n<p>LINE BOT\u306b\u306fSSL\u304c\u5fc5\u8981\u306a\u306e\u3068\u56fa\u5b9aIP\u304c\u5fc5\u8981\u306a\u306e\u3067\u3001YOUR SYSEM\u306e\u90e8\u5206\u306e\u30b5\u30fc\u30d0\u306b\u306fheroku\u3092\u4f7f\u3044\u307e\u3059\u3002<br \/>\nheroku\u306f\u56fa\u5b9aIP\u3067\u306f\u306a\u3044\u306e\u3067\u3059\u304c\u3001Fixie\u3068\u3044\u3046\u30a2\u30c9\u30aa\u30f3\u3092\u4f7f\u3046\u3068\u3001\u30d7\u30ed\u30ad\u30b7\u3092\u7d4c\u7531\u3057\u3066\u304f\u308c\u308b\u306e\u3067IP\u3092\u56fa\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>LINE\u3078\u306e\u767b\u9332<\/h2>\n<p>LINE BOT API\u306e\u30c8\u30e9\u30a4\u30a2\u30eb\u306f<a href=\"https:\/\/business.line.me\">https:\/\/business.line.me<\/a> \u304b\u3089\u767b\u9332\u3067\u304d\u307e\u3059\u3002<br \/>\n\u3059\u3067\u306b\u30c8\u30e9\u30a4\u30a2\u30eb\u306e\u914d\u5e03\u306f\u4e0a\u9650\u306b\u9054\u3057\u3066\u3057\u307e\u3044\u7d42\u308f\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u79c1\u306f\u3053\u3063\u305d\u308a\u767b\u9332\u3057\u3066\u3042\u3063\u305f\u3082\u306e\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30d9\u30ed\u30c3\u30d1\u30fc\u767b\u9332\u304c\u7d42\u308f\u308b\u3068\u3001\u4ee5\u4e0b\u306e3\u3064\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<br \/>\n<strong>Channel ID<\/strong><br \/>\n<strong>Channel Secret<\/strong><br \/>\n<strong>MID<\/strong><\/p>\n<p>\u5f8c\u3067\u30a2\u30d7\u30ea\u3067\u5229\u7528\u3057\u307e\u3059\u306e\u3067\u30e1\u30e2\u3063\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/0467725d66decbd69420f07abe5c8b98.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/0467725d66decbd69420f07abe5c8b98-1024x340.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_2016-06-02_02_56_24\" width=\"793\" height=\"263\" class=\"alignnone size-large wp-image-451\" srcset=\"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/0467725d66decbd69420f07abe5c8b98-1024x340.png 1024w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/0467725d66decbd69420f07abe5c8b98-300x100.png 300w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/0467725d66decbd69420f07abe5c8b98-768x255.png 768w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/0467725d66decbd69420f07abe5c8b98.png 1339w\" sizes=\"(max-width: 793px) 100vw, 793px\" \/><\/a><\/p>\n<h2>heroku\u306b\u30a2\u30d7\u30ea\u4f5c\u6210<\/h2>\n<p>heroku\u306b\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\nheroku\u306fIP\u304c\u56fa\u5b9a\u3067\u306f\u306a\u3044\u306e\u3067\u3059\u304c\u3001Fixie\u3068\u3044\u3046\u30a2\u30c9\u30aa\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<br \/>\nFixie\u3092\u4f7f\u3046\u3068\u30d7\u30ed\u30ad\u30b7\u3092\u7d4c\u7531\u3059\u308b\u3088\u3046\u306b\u306a\u308b\u306e\u3067\u3001\u63a5\u7d9a\u5143IP\u3092\u56fa\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ heroku login\r\n$ heroku create your_app\r\n$ heroku addons:create fixie:tricycle\r\n<\/pre>\n<h2>Server IP Whitelist\u306b\u56fa\u5b9aIP\u3092\u767b\u9332<\/h2>\n<p>LINE BOT API\u3092\u547c\u3076\u306b\u306fLINE BOT API\u306bFixie\u3067\u56fa\u5b9a\u3057\u305f\u63a5\u7d9a\u5143IP(Whitelist)\u3092\u767b\u9332\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>heroku\u4e0a\u3067\u4f5c\u3063\u305f\u30a2\u30d7\u30ea\u306e\u8a2d\u5b9a\u753b\u9762\u304b\u3089 Fixie \u306e\u753b\u9762\u3092\u958b\u304f\u3068\u6b21\u306e\u3088\u3046\u306a\u753b\u9762\u306b\u306a\u308b\u306e\u3067\u3001<br \/>\n<strong>Outbound IPs<\/strong><br \/>\n\u306e2\u3064\u306e\u5024\u3092\u30e1\u30e2\u3063\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u3055\u3089\u306b<br \/>\n<strong>Proxy URL<\/strong><br \/>\n\u3082\u3042\u3068\u3067\u4f7f\u3046\u306e\u3067\u30e1\u30e2\u3063\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/576f715b0eccdee0d3f9c61ac47db624.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/576f715b0eccdee0d3f9c61ac47db624-1024x565.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_2016-06-02_02_26_01\" width=\"793\" height=\"438\" class=\"alignnone size-large wp-image-447\" srcset=\"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/576f715b0eccdee0d3f9c61ac47db624-1024x565.png 1024w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/576f715b0eccdee0d3f9c61ac47db624-300x165.png 300w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/576f715b0eccdee0d3f9c61ac47db624-768x424.png 768w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/576f715b0eccdee0d3f9c61ac47db624.png 1164w\" sizes=\"(max-width: 793px) 100vw, 793px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/business.line.me\">https:\/\/business.line.me<\/a>\u304b\u3089<br \/>\nChannels \u2192\u3000Server IP Whitelist\u3092\u9078\u3073\u3001\u300cServer IP Whitelist\u300d\u306b\u30e1\u30e2\u3063\u305fOutbound IPs\u3092\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/74b5f065ae243e78412d9d908c9e7025.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/74b5f065ae243e78412d9d908c9e7025-1024x504.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_2016-06-02_02_39_42\" width=\"793\" height=\"390\" class=\"alignnone size-large wp-image-449\" srcset=\"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/74b5f065ae243e78412d9d908c9e7025-1024x504.png 1024w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/74b5f065ae243e78412d9d908c9e7025-300x148.png 300w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/74b5f065ae243e78412d9d908c9e7025-768x378.png 768w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/74b5f065ae243e78412d9d908c9e7025.png 1334w\" sizes=\"(max-width: 793px) 100vw, 793px\" \/><\/a><\/p>\n<h2>\u30b3\u30fc\u30eb\u30d0\u30c3\u30afURL\u306e\u767b\u9332<\/h2>\n<p>\u30b3\u30fc\u30eb\u30d0\u30c3\u30afURL\u3092LINE BOT API\u306b\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f<strong>http:\/\/xxx.com:443\/callback<\/strong>\u3068\u3044\u3046URL\u3067\u5f8c\u8ff0\u306e\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3057\u3088\u3046\u3068\u304a\u3082\u3044\u307e\u3059\u3002(xxx.com\u306e\u90e8\u5206\u306fheroku\u306eURL)<br \/>\n<a href=\"https:\/\/business.line.me\">https:\/\/business.line.me<\/a>\u304b\u3089<br \/>\nChannels \u2192\u3000Basic Infomation\u3092\u9078\u3073\u3001\u4e0b\u306e\u65b9\u306b\u3042\u308bEDIT\u30dc\u30bf\u30f3\u3088\u308a\u300cCallback URL\u300d\u3092\u767b\u9332\u3057\u307e\u3059\u3002<br \/>\n\u305d\u306e\u969b\u30d7\u30ed\u30c8\u30b3\u30eb\u306fhttps\u3001\u30dd\u30fc\u30c8\u756a\u53f7\u306f443\u3092\u5fc5\u305a\u6307\u5b9a\u3057\u307e\u3059\u3002(\u6307\u5b9a\u3057\u306a\u3044\u3068\u6b63\u3057\u304f\u547c\u3073\u51fa\u305b\u306a\u3044\u3089\u3057\u3044\u3002)<\/p>\n<p><strong>https:\/\/xxxx.com:443\/callback<\/strong><\/p>\n<p><a href=\"http:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/c1dc10760268e41eb94856e9c6a6cfaf.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/c1dc10760268e41eb94856e9c6a6cfaf-1024x520.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8_2016-06-02_02_48_24\" width=\"793\" height=\"403\" class=\"alignnone size-large wp-image-452\" srcset=\"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/c1dc10760268e41eb94856e9c6a6cfaf-1024x520.png 1024w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/c1dc10760268e41eb94856e9c6a6cfaf-300x152.png 300w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/c1dc10760268e41eb94856e9c6a6cfaf-768x390.png 768w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/c1dc10760268e41eb94856e9c6a6cfaf.png 1334w\" sizes=\"(max-width: 793px) 100vw, 793px\" \/><\/a><\/p>\n<p>\u3053\u308c\u3067\u4e8b\u524d\u6e96\u5099\u306f\u7d42\u308f\u308a\u3067\u3059\u3002<br \/>\n\u6b21\u304b\u3089\u306f\u672c\u984c\u306eBOT\u7528\u30a2\u30d7\u30ea\u4f5c\u6210\u3067\u3059\u3002<\/p>\n<h2>Rails\u30a2\u30d7\u30ea\u306e\u4f5c\u6210<\/h2>\n<p>\u6b21\u306b\u3001\u81ea\u5206\u306e\u30de\u30b7\u30f3\u306b\u65b0\u3057\u3044Rails\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ rails new your_app\r\n<\/pre>\n<p>heroku\u306eDB\u306b\u306fPostgreSQL\u3001LINE BOT API\u3068\u306eHTTP\u63a5\u7d9a\u306b\u306fFaraday\u3092\u4f7f\u3046\u306e\u3067\u3001Gemfile\u306b\u4ee5\u4e0b\u3092\u8ffd\u52a0\u3002<\/p>\n<pre class=\"brush: ruby; title: Gemfile; notranslate\" title=\"Gemfile\">\r\ngem &quot;pg&quot;\r\ngem &quot;faraday&quot;\r\ngem &quot;faraday_middleware&quot;\r\n<\/pre>\n<p>\u524d\u306e\u4eba\u304c\u8a71\u3057\u305f\u8a00\u8449\u3084\u3001\u30e6\u30fc\u30b6\u306e\u7ba1\u7406\u306b\u306fheroku\u3067\u5229\u7528\u3067\u304d\u308bPostgresql\u3092\u4f7f\u3046\u306e\u3067\u3001database.yml\u306b\u4ee5\u4e0b\u3092\u8ffd\u52a0\u3002<br \/>\ndatabase\u3001username\u3001password\u306b\u95a2\u3057\u3066\u306fheroku\u306b\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3068\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: ruby; title: database.yml; notranslate\" title=\"database.yml\">\r\nproduction:\r\nadapter: postgresql\r\nencoding: utf8\r\ndatabase: your_database\r\nport: 5432\r\nusername: your_username\r\npassword: your_password\r\n<\/pre>\n<p>route.rb\u306bLINE BOT API\u306b\u767b\u9332\u3059\u308b\u30b3\u30fc\u30eb\u30d0\u30c3\u30afURL\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u8a2d\u5b9a<\/p>\n<pre class=\"brush: ruby; title: config\/route.rb; notranslate\" title=\"config\/route.rb\">\r\nRails.application.routes.draw do\r\n  post '\/callback' =&gt; 'webhook#callback'  \r\nend\r\n<\/pre>\n<p>\u30e6\u30fc\u30b6\u3092\u7ba1\u7406\u3059\u308b\u30e2\u30c7\u30eb\u306e\u4f5c\u6210<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ rails generate model users mid:string display_name:string status:integer\r\n<\/pre>\n<p>\u524d\u306e\u4eba\u304c\u8a71\u3057\u305f\u8a00\u8449\u3092\u7ba1\u7406\u3059\u308b\u30e6\u30fc\u30b6\u306e\u7ba1\u7406\u3059\u308b\u30e2\u30c7\u30eb\u306e\u4f5c\u6210<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ rails generate model messages user_id:integer text_message:string\r\n<\/pre>\n<p>\u6b21\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3002<\/p>\n<pre class=\"brush: ruby; title: app\/controllers\/webhook_controller.rb; notranslate\" title=\"app\/controllers\/webhook_controller.rb\">\r\nclass WebhookController &lt; ApplicationController\r\n  protect_from_forgery with: :null_session\r\n\r\n  CHANNEL_ID =  ENV['LINE_CHANNEL_ID']\r\n  CHANNEL_SECRET = ENV['LINE_CHANNEL_SECRET']\r\n  CHANNEL_MID = ENV['LINE_CHANNEL_MID']\r\n  OUTBOUND_PROXY = ENV['LINE_OUTBOUND_PROXY']\r\n\r\n  def callback\r\n    unless is_validate_signature\r\n      render :nothing =&gt; true, status: 470\r\n    end\r\n    result = params[:result][0]\r\n    logger.info({from_line: result})\r\n\r\n    if result['content']['opType'].present?\r\n\r\n      mid = result['content']['params'][0]\r\n\r\n      client = LineClient.new(CHANNEL_ID, CHANNEL_SECRET, CHANNEL_MID, OUTBOUND_PROXY)\r\n      res = client.profile(mid)\r\n\r\n      if res.status == 200\r\n        logger.info({success: res})\r\n\r\n        display_name = res.body['contacts'][0]['displayName']\r\n\r\n        opType = result['content']['opType']\r\n        case opType \r\n        when 4 then\r\n          user = User.create_with(display_name: display_name, status: 4).find_or_create_by(mid: mid)\r\n          user.display_name = display_name\r\n          user.status = 4\r\n          user.save!\r\n        when 8 then\r\n          user = User.create_with(display_name: display_name, status: 8).find_or_create_by(mid: mid)\r\n          user.display_name = display_name\r\n          user.status = 8\r\n          user.save!\r\n        else\r\n        end\r\n      else\r\n        logger.info({fail: res})\r\n      end\r\n    else \r\n      text_message = result['content']['text']\r\n      from_mid = result['content']['from']\r\n\r\n      last_message = Message.last.text_message\r\n\r\n      user = User.find_by(mid: from_mid)\r\n\r\n      Message.create(user_id: user.id, text_message: text_message)\r\n\r\n      message = last_message + &quot;\u304c\u5148\u304b\u3001&quot; + text_message + &quot;\u304c\u5148\u304b&quot;\r\n\r\n      client = LineClient.new(CHANNEL_ID, CHANNEL_SECRET, CHANNEL_MID, OUTBOUND_PROXY)\r\n      res = client.send([from_mid], message)\r\n\r\n      if res.status == 200\r\n        logger.info({success: res})\r\n      else\r\n        logger.info({fail: res})\r\n      end\r\n    end\r\n\r\n    render :nothing =&gt; true, status: :ok\r\n  end\r\n\r\n  private\r\n  def is_validate_signature\r\n    signature = request.headers[&quot;X-LINE-ChannelSignature&quot;]\r\n    http_request_body = request.raw_post\r\n    hash = OpenSSL::HMAC::digest(OpenSSL::Digest::SHA256.new, CHANNEL_SECRET, http_request_body)\r\n    signature_answer = Base64.strict_encode64(hash)\r\n    signature == signature_answer\r\n  end\r\nend\r\n<\/pre>\n<p>LINE BOT API\u3092\u547c\u3076\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4f5c\u6210\u3002<\/p>\n<pre class=\"brush: ruby; title: lib\/line_client.rb; notranslate\" title=\"lib\/line_client.rb\">\r\nrequire &quot;faraday&quot;\r\nrequire &quot;faraday_middleware&quot;\r\nrequire &quot;json&quot;\r\nrequire &quot;pp&quot;\r\n\r\nclass LineClient\r\n  module ContentType\r\n    TEXT = 1\r\n    IMAGE = 2\r\n    VIDEO = 3\r\n    AUDIO = 4\r\n    LOCATION = 7\r\n    STICKER = 8\r\n    CONTACT = 10\r\n  end\r\n  module ToType\r\n    USER = 1\r\n  end\r\n\r\n  END_POINT = &quot;https:\/\/trialbot-api.line.me&quot;\r\n  TO_CHANNEL = &quot;1383378250&quot; # Fixed value\r\n  EVENT_TYPE = &quot;138311608800106203&quot; # Fixed value\r\n\r\n  def initialize(channel_id, channel_secret, channel_mid, proxy = nil)\r\n    @channel_id = channel_id\r\n    @channel_secret = channel_secret\r\n    @channel_mid = channel_mid\r\n    @proxy = proxy\r\n  end\r\n\r\n  def post(path, data)\r\n    client = Faraday.new(:url =&gt; END_POINT) do |conn|\r\n      conn.request :json\r\n      conn.response :json, :content_type =&gt; \/\\bjson$\/\r\n      conn.adapter Faraday.default_adapter\r\n      conn.proxy @proxy\r\n    end\r\n\r\n    res = client.post do |request|\r\n      request.url path\r\n      request.headers = {\r\n          'Content-type' =&gt; 'application\/json; charset=UTF-8',\r\n          'X-Line-ChannelID' =&gt; @channel_id,\r\n          'X-Line-ChannelSecret' =&gt; @channel_secret,\r\n          'X-Line-Trusted-User-With-ACL' =&gt; @channel_mid\r\n      }\r\n      request.body = data\r\n    end\r\n    res\r\n  end\r\n\r\n  def get(path, data)\r\n    client = Faraday.new(:url =&gt; END_POINT) do |conn|\r\n      conn.request :json\r\n      conn.response :json, :content_type =&gt; \/\\bjson$\/\r\n      conn.adapter Faraday.default_adapter\r\n      conn.proxy @proxy\r\n    end\r\n\r\n    res = client.get do |request|\r\n      request.url path, data\r\n      request.headers = {\r\n          'Content-type' =&gt; 'application\/json; charset=UTF-8',\r\n          'X-Line-ChannelID' =&gt; @channel_id,\r\n          'X-Line-ChannelSecret' =&gt; @channel_secret,\r\n          'X-Line-Trusted-User-With-ACL' =&gt; @channel_mid\r\n      }\r\n    end\r\n    res\r\n  end\r\n\r\n  def send(line_ids, message)\r\n    post('\/v1\/events', {\r\n        to: line_ids,\r\n        content: {\r\n            contentType: ContentType::TEXT,\r\n            toType: ToType::USER,\r\n            text: message\r\n        },\r\n        toChannel: TO_CHANNEL,\r\n        eventType: EVENT_TYPE\r\n    })\r\n  end\r\n\r\n  def profile(mids)\r\n    get('\/v1\/profiles', {\r\n      mids: mids\r\n    })\r\n  end\r\nend\r\n<\/pre>\n<h2>heroku ENV\u306e\u8a2d\u5b9a<\/h2>\n<p>LINE BOT API\u306e\u60c5\u5831<br \/>\n<strong>Channel ID<\/strong><br \/>\n<strong>Channel Secret<\/strong><br \/>\n<strong>MID<\/strong><br \/>\n\u3068FIXIE\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u60c5\u5831\u306b\u3042\u3063\u305f<br \/>\n<strong>PROXY URL<\/strong><br \/>\n\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306eENV\u306fRails\u30d7\u30ed\u30b0\u30e9\u30e0\u304b\u3089\u53c2\u7167\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ heroku config:add LINE_CHANNEL_ID=&quot;xxxxxx&quot;\r\n$ heroku config:add LINE_CHANNEL_SECRET=&quot;xxxxxx&quot;\r\n$ heroku config:add LINE_CHANNEL_MID=&quot;xxxxxx&quot;\r\n$ heroku config:add FIXIE_URL=&quot;http:\/\/xxxxxx&quot;\r\n<\/pre>\n<h2>heroku\u3078\u30c7\u30d7\u30ed\u30a4<\/h2>\n<p>\u6700\u5f8c\u306bheroku\u3078\u30c7\u30d7\u30ed\u30a4\u3057\u307e\u3059<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ git add .\r\n$ git commit -m 'xxxxxx'\r\n$ git push heroku master\r\n<\/pre>\n<p>DB\u304c\u3042\u308b\u306e\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30c8\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ heroku run rake db:migrate\r\n<\/pre>\n<p>\u3053\u308c\u3067\u6e96\u5099\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<h2>LINE\u304b\u3089\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/h2>\n<p>LINE\u304c\u5165\u3063\u3066\u3044\u308b\u30b9\u30de\u30db\u304b\u3089\u53cb\u9054\u8ffd\u52a0\u3002<\/p>\n<p><a href=\"http:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/IMG_4100.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/IMG_4100-576x1024.png\" alt=\"IMG_4100\" width=\"576\" height=\"1024\" class=\"alignnone size-large wp-image-462\" srcset=\"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/IMG_4100-576x1024.png 576w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/IMG_4100-169x300.png 169w, https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/IMG_4100.png 750w\" sizes=\"(max-width: 576px) 100vw, 576px\" \/><\/a><\/p>\n<p>\u3046\u307e\u304f\u52d5\u3044\u3066\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u307e\u3060\u30c8\u30e9\u30a4\u30a2\u30eb\u306a\u306e\u306750\u4eba\u307e\u3067\u3057\u304b\u53cb\u9054\u5897\u3084\u305b\u306a\u3044\u307f\u305f\u3044\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u30b7\u30f3\u30d7\u30eb\u306a\u30ed\u30b8\u30c3\u30af\u306eBOT\u3092\u3064\u304f\u308a\u307e\u3057\u305f\u304c\u3001\u5de5\u592b\u6b21\u7b2c\u3067\u9762\u767d\u3044\u3082\u306e\u304c\u4f5c\u308c\u305d\u3046\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u3070\u3093\u306f \u305f\u307e\u306b\u306f\u30a8\u30f3\u30b8\u30cb\u30a2\u3063\u307d\u3044\u3068\u3053\u308d\u3092\u898b\u305b\u3088\u3046\u3068\u601d\u3044\u3001\u9045\u308c\u3070\u305b\u306a\u304c\u3089\u3001\u6d41\u884c &#8230; <\/p>\n","protected":false},"author":3,"featured_media":437,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[7],"tags":[34,33,15],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.13 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>LINE BOT\u3092\u7121\u6599\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002heroku + Rails | \u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cotegg.com\/blog\/?p=436\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"LINE BOT\u3092\u7121\u6599\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002heroku + Rails | \u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4\" \/>\n<meta property=\"og:description\" content=\"\u3053\u3093\u3070\u3093\u306f \u305f\u307e\u306b\u306f\u30a8\u30f3\u30b8\u30cb\u30a2\u3063\u307d\u3044\u3068\u3053\u308d\u3092\u898b\u305b\u3088\u3046\u3068\u601d\u3044\u3001\u9045\u308c\u3070\u305b\u306a\u304c\u3089\u3001\u6d41\u884c ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cotegg.com\/blog\/?p=436\" \/>\n<meta property=\"og:site_name\" content=\"\u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/COTegg.japan\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-04-24T19:01:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-06-26T02:52:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/bot_img001.png\" \/>\n\t<meta property=\"og:image:width\" content=\"740\" \/>\n\t<meta property=\"og:image:height\" content=\"307\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"\u9ad8\u77f3 \u660e\u7fa9\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cotegg_japan\" \/>\n<meta name=\"twitter:site\" content=\"@cotegg_japan\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u9ad8\u77f3 \u660e\u7fa9\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"4\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/?p=436#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.cotegg.com\/blog\/?p=436\"},\"author\":{\"name\":\"\u9ad8\u77f3 \u660e\u7fa9\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/#\/schema\/person\/10428a5949d2b24b6f186d6b171b2184\"},\"headline\":\"LINE BOT\u3092\u7121\u6599\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002heroku + Rails\",\"datePublished\":\"2016-04-24T19:01:00+00:00\",\"dateModified\":\"2016-06-26T02:52:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.cotegg.com\/blog\/?p=436\"},\"wordCount\":851,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/www.cotegg.com\/blog\/#organization\"},\"keywords\":[\"heroku\",\"LINE BOT\",\"rails\"],\"articleSection\":[\"\u6280\u8853\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.cotegg.com\/blog\/?p=436#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/?p=436\",\"url\":\"https:\/\/www.cotegg.com\/blog\/?p=436\",\"name\":\"LINE BOT\u3092\u7121\u6599\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002heroku + Rails | \u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4\",\"isPartOf\":{\"@id\":\"https:\/\/www.cotegg.com\/blog\/#website\"},\"datePublished\":\"2016-04-24T19:01:00+00:00\",\"dateModified\":\"2016-06-26T02:52:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.cotegg.com\/blog\/?p=436#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.cotegg.com\/blog\/?p=436\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/?p=436#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.cotegg.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LINE BOT\u3092\u7121\u6599\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002heroku + Rails\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/#website\",\"url\":\"https:\/\/www.cotegg.com\/blog\/\",\"name\":\"COTegg\u306e\u30d0\u30b1\u30c4\",\"description\":\"- Bucket of cotegg -\",\"publisher\":{\"@id\":\"https:\/\/www.cotegg.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.cotegg.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/#organization\",\"name\":\"COTegg Inc.\",\"url\":\"https:\/\/www.cotegg.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2015\/07\/logo_color1_yoko-e1436354651882.png\",\"contentUrl\":\"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2015\/07\/logo_color1_yoko-e1436354651882.png\",\"width\":176,\"height\":60,\"caption\":\"COTegg Inc.\"},\"image\":{\"@id\":\"https:\/\/www.cotegg.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/COTegg.japan\/\",\"https:\/\/twitter.com\/cotegg_japan\",\"https:\/\/www.instagram.com\/cotegg_japan\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/#\/schema\/person\/10428a5949d2b24b6f186d6b171b2184\",\"name\":\"\u9ad8\u77f3 \u660e\u7fa9\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.cotegg.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/64eb43b0255dd7803d6dbe97df9ab603?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/64eb43b0255dd7803d6dbe97df9ab603?s=96&d=mm&r=g\",\"caption\":\"\u9ad8\u77f3 \u660e\u7fa9\"},\"sameAs\":[\"http:\/\/www.cotegg.com\"],\"url\":\"https:\/\/www.cotegg.com\/blog\/?author=3\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"LINE BOT\u3092\u7121\u6599\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002heroku + Rails | \u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.cotegg.com\/blog\/?p=436","og_locale":"ja_JP","og_type":"article","og_title":"LINE BOT\u3092\u7121\u6599\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002heroku + Rails | \u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4","og_description":"\u3053\u3093\u3070\u3093\u306f \u305f\u307e\u306b\u306f\u30a8\u30f3\u30b8\u30cb\u30a2\u3063\u307d\u3044\u3068\u3053\u308d\u3092\u898b\u305b\u3088\u3046\u3068\u601d\u3044\u3001\u9045\u308c\u3070\u305b\u306a\u304c\u3089\u3001\u6d41\u884c ...","og_url":"https:\/\/www.cotegg.com\/blog\/?p=436","og_site_name":"\u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4","article_publisher":"https:\/\/www.facebook.com\/COTegg.japan\/","article_published_time":"2016-04-24T19:01:00+00:00","article_modified_time":"2016-06-26T02:52:49+00:00","og_image":[{"width":740,"height":307,"url":"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2016\/06\/bot_img001.png","type":"image\/png"}],"author":"\u9ad8\u77f3 \u660e\u7fa9","twitter_card":"summary_large_image","twitter_creator":"@cotegg_japan","twitter_site":"@cotegg_japan","twitter_misc":{"\u57f7\u7b46\u8005":"\u9ad8\u77f3 \u660e\u7fa9","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"4\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cotegg.com\/blog\/?p=436#article","isPartOf":{"@id":"https:\/\/www.cotegg.com\/blog\/?p=436"},"author":{"name":"\u9ad8\u77f3 \u660e\u7fa9","@id":"https:\/\/www.cotegg.com\/blog\/#\/schema\/person\/10428a5949d2b24b6f186d6b171b2184"},"headline":"LINE BOT\u3092\u7121\u6599\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002heroku + Rails","datePublished":"2016-04-24T19:01:00+00:00","dateModified":"2016-06-26T02:52:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cotegg.com\/blog\/?p=436"},"wordCount":851,"commentCount":2,"publisher":{"@id":"https:\/\/www.cotegg.com\/blog\/#organization"},"keywords":["heroku","LINE BOT","rails"],"articleSection":["\u6280\u8853"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.cotegg.com\/blog\/?p=436#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.cotegg.com\/blog\/?p=436","url":"https:\/\/www.cotegg.com\/blog\/?p=436","name":"LINE BOT\u3092\u7121\u6599\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002heroku + Rails | \u30b3\u30fc\u30c6\u30c3\u30b0\u306e\u30d0\u30b1\u30c4","isPartOf":{"@id":"https:\/\/www.cotegg.com\/blog\/#website"},"datePublished":"2016-04-24T19:01:00+00:00","dateModified":"2016-06-26T02:52:49+00:00","breadcrumb":{"@id":"https:\/\/www.cotegg.com\/blog\/?p=436#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cotegg.com\/blog\/?p=436"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.cotegg.com\/blog\/?p=436#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cotegg.com\/blog"},{"@type":"ListItem","position":2,"name":"LINE BOT\u3092\u7121\u6599\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002heroku + Rails"}]},{"@type":"WebSite","@id":"https:\/\/www.cotegg.com\/blog\/#website","url":"https:\/\/www.cotegg.com\/blog\/","name":"COTegg\u306e\u30d0\u30b1\u30c4","description":"- Bucket of cotegg -","publisher":{"@id":"https:\/\/www.cotegg.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cotegg.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/www.cotegg.com\/blog\/#organization","name":"COTegg Inc.","url":"https:\/\/www.cotegg.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.cotegg.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2015\/07\/logo_color1_yoko-e1436354651882.png","contentUrl":"https:\/\/www.cotegg.com\/blog\/wp-content\/uploads\/2015\/07\/logo_color1_yoko-e1436354651882.png","width":176,"height":60,"caption":"COTegg Inc."},"image":{"@id":"https:\/\/www.cotegg.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/COTegg.japan\/","https:\/\/twitter.com\/cotegg_japan","https:\/\/www.instagram.com\/cotegg_japan\/"]},{"@type":"Person","@id":"https:\/\/www.cotegg.com\/blog\/#\/schema\/person\/10428a5949d2b24b6f186d6b171b2184","name":"\u9ad8\u77f3 \u660e\u7fa9","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.cotegg.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/64eb43b0255dd7803d6dbe97df9ab603?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/64eb43b0255dd7803d6dbe97df9ab603?s=96&d=mm&r=g","caption":"\u9ad8\u77f3 \u660e\u7fa9"},"sameAs":["http:\/\/www.cotegg.com"],"url":"https:\/\/www.cotegg.com\/blog\/?author=3"}]}},"_links":{"self":[{"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/436"}],"collection":[{"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=436"}],"version-history":[{"count":24,"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/436\/revisions"}],"predecessor-version":[{"id":494,"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/436\/revisions\/494"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/437"}],"wp:attachment":[{"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cotegg.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}