Created
March 10, 2017 23:52
-
-
Save raspberrypisig/31753bf1f4d97a1f71f9184ca72fe9ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":"b3ea0c65.273048","type":"inject","z":"66f31273.a277dc","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":120.49998474121094,"y":50.59999084472656,"wires":[["7f03a9bc.004b58"]]},{"id":"163fd9ec.660ad6","type":"http request","z":"66f31273.a277dc","name":"","method":"POST","ret":"obj","url":"https://api.telstra.com/v1/oauth/token","tls":"","x":442.5,"y":55.19999694824219,"wires":[["fc694715.ed64c"]]},{"id":"ac66338c.040f38","type":"function","z":"66f31273.a277dc","name":"","func":"msg.headers={\n 'Content-Type':'application/x-www-form-urlencoded' \n};\nmsg.originalpayload = msg.payload;\nmsg.payload={\n client_id: msg.payload.CONSUMER_KEY,\n client_secret: msg.payload.CONSUMER_SECRET,\n grant_type: \"client_credentials\",\n scope: \"SMS\"\n};\nreturn msg;","outputs":1,"noerr":0,"x":275.5,"y":55,"wires":[["163fd9ec.660ad6"]]},{"id":"66203ba4.a5a314","type":"http request","z":"66f31273.a277dc","name":"","method":"POST","ret":"txt","url":"https://api.telstra.com/v1/sms/messages","tls":"","x":467.50003814697266,"y":328.80000591278076,"wires":[[]]},{"id":"fc694715.ed64c","type":"function","z":"66f31273.a277dc","name":"","func":"msg.headers = {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer \" + msg.payload.access_token\n};\nmessage={\n \"to\": msg.originalpayload.MOBILE,\n \"body\": msg.originalpayload.MESSAGE\n};\nmsg.payload = JSON.stringify(message);\nreturn msg;","outputs":1,"noerr":0,"x":139.50000381469727,"y":350.5999927520752,"wires":[["66203ba4.a5a314"]]},{"id":"7f03a9bc.004b58","type":"template","z":"66f31273.a277dc","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\"CONSUMER_KEY\":\"PUT CONSUMER KEY HERE\", \n\"CONSUMER_SECRET\":\"PUT CONSUMER SECRET HERE\", \n\"MOBILE\":\"04xxxxxxxx\", \n\"MESSAGE\":\"INSERT MESSAGE HERE\"\n}","x":94.10000991821289,"y":159.60000324249268,"wires":[["82557f8d.2ced3"]]},{"id":"82557f8d.2ced3","type":"json","z":"66f31273.a277dc","name":"","x":232.10000610351562,"y":163.40001583099365,"wires":[["ac66338c.040f38"]]}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment