Skip to content

Instantly share code, notes, and snippets.

@tomsato
Created August 20, 2017 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomsato/a2fd425655f161aefdb30222239b96ac to your computer and use it in GitHub Desktop.
Save tomsato/a2fd425655f161aefdb30222239b96ac to your computer and use it in GitHub Desktop.
[
{
"id": "7f5055b6.6ac83c",
"type": "http in",
"z": "e9ed6c54.27109",
"name": "POST sample ",
"url": "/sample",
"method": "post",
"upload": false,
"swaggerDoc": "",
"x": 95,
"y": 75,
"wires": [
[
"d55ce5ac.6feef8"
]
]
},
{
"id": "d55ce5ac.6feef8",
"type": "function",
"z": "e9ed6c54.27109",
"name": "request body header作成",
"func": "var event = msg.payload[\"events\"][0];\nif(event[\"message\"][\"type\"] != \"text\"){\n return msg;\n}\nvar message = event[\"message\"][\"text\"];\nvar replyToken = event[\"replyToken\"];\nvar replyMessage = {\"type\": \"text\", \"text\": message}\nmsg.payload = {\"messages\": [replyMessage], \"replyToken\": replyToken};\nmsg.headers ={ \"Content-Type\": \"application/json\", \"Authorization\": \"Bearer XXXXX\"};\n\nreturn msg",
"outputs": 1,
"noerr": 0,
"x": 307,
"y": 75,
"wires": [
[
"c0937d88.f5d79",
"827480b6.8a011"
]
]
},
{
"id": "c0937d88.f5d79",
"type": "http request",
"z": "e9ed6c54.27109",
"name": "LINE REPLY API実行",
"method": "POST",
"ret": "txt",
"url": "https://api.line.me/v2/bot/message/reply",
"tls": "",
"x": 627,
"y": 106,
"wires": [
[
"de6721d2.d6d9c"
]
]
},
{
"id": "de6721d2.d6d9c",
"type": "debug",
"z": "e9ed6c54.27109",
"name": "APIリクエスト結果表示",
"active": true,
"console": "false",
"complete": "payload",
"x": 902,
"y": 106,
"wires": []
},
{
"id": "827480b6.8a011",
"type": "debug",
"z": "e9ed6c54.27109",
"name": "request内容デバッグ表示",
"active": true,
"console": "false",
"complete": "payload",
"x": 640,
"y": 50,
"wires": []
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment