Node-Red 發行權杖(文字變數方式 輸入)
[{"id":"6944024744e01276","type":"function","z":"e4f0d10c6b941ff5","name":"Set Line API ","func":"var a=flow.get('templineID');\ntemp1='content-type';\ntemp2='application/x-www-form-urlencoded';\ntemp3='Authorization';\ntemp4='Bearer ';\n\nmsg.headers = {};\nmsg.headers['content-type'] = temp2;\nmsg.headers['Authorization'] = temp4 +a;\n\n//msg.headers = {'content-type':'application/x-www-form-urlencoded','Authorization':'Bearer A4wwPNh2WqB7dlfeQyyIAwtggn1kfZSI5LkkCdia1gB'};\nmsg.payload = {\"message\":msg.payload};\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":240,"wires":[["e24fb7fbaf89f6be","1daa7a64f285bad5"]]},{"id":"e24fb7fbaf89f6be","type":"http request","z":"e4f0d10c6b941ff5","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"https://notify-api.line.me/api/notify","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":520,"y":240,"wires":[["959a342e94b65f20"]]},{"id":"959a342e94b65f20","type":"debug","z":"e4f0d10c6b941ff5","name":"debug 331","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":690,"y":240,"wires":[]},{"id":"cf4e9da7dbea02fd","type":"inject","z":"e4f0d10c6b941ff5","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"哈囉","payloadType":"str","x":130,"y":240,"wires":[["6944024744e01276","c61fcb743d5ebff2"]]},{"id":"b7ea0583ef3ab84e","type":"debug","z":"e4f0d10c6b941ff5","name":"debug 332","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":710,"y":320,"wires":[]},{"id":"4365ca2c808b7c5b","type":"function","z":"e4f0d10c6b941ff5","name":"function 107","func":"var a = msg.payload;\nflow.set('templineID',a);\nreturn msg;\n\n//global.set('variableName', value);","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":320,"wires":[["b7ea0583ef3ab84e"]]},{"id":"b1e434d69147abe4","type":"ui_template","z":"e4f0d10c6b941ff5","group":"51e26c626e03b634","name":"user input validate","order":3,"width":6,"height":2,"format":"<md-input-container style=\"overflow:hidden;\">\n <span> \n <input ng-model=\"user.input\" style=\"width:150px\" placeholder={{msg.topic}}><button class=\"bluebutton\" ng-click=\"msg.payload = user.input; send(msg)\" ng-keypress=\"($event.charCode==13)?msg.payload = user.input; send(msg)\" ngstyle=\"{background-color: #008CBA;}\" style=\"\n color: #fff;\n background-color: #5bc0de;\n border-color: #46b8da;\">Ok</button></span>\n</md-input-container>\n ","storeOutMessages":true,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","className":"","x":150,"y":320,"wires":[["4365ca2c808b7c5b"]]},{"id":"c61fcb743d5ebff2","type":"function","z":"e4f0d10c6b941ff5","name":"function 108","func":"var a=flow.get('templineID');\nmsg.payload=a;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":290,"y":280,"wires":[["03e5bd782281d2c7"]]},{"id":"03e5bd782281d2c7","type":"debug","z":"e4f0d10c6b941ff5","name":"debug 333","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":470,"y":280,"wires":[]},{"id":"1daa7a64f285bad5","type":"debug","z":"e4f0d10c6b941ff5","name":"debug 334","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"headers","targetType":"msg","statusVal":"","statusType":"auto","x":550,"y":200,"wires":[]},{"id":"51e26c626e03b634","type":"ui_group","name":"Line Test","tab":"69f084718b04cc3e","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"69f084718b04cc3e","type":"ui_tab","name":"Line Notify Examples","icon":"dashboard","order":138,"disabled":false,"hidden":false}]
沒有留言:
張貼留言