Mod Edit (@harrisonhjones): Solution: See this post
Hi,
I’m trying to set up an SMS notifcation when a switch is tripped.
I am using an electron with a particle SIM so I know I cannot do this directly but should be able to through a webhook. I have got a webhook working OK to send an email when the switch is tripped using mailgun thanks to Webhook Tutorial - Send an Email!.
However I would much prefer to use SMS for the notification and have spend a day or so trying to get it working with twilio, having followed various posts and particularly Webhooks + Sending a text message.
However I keep getting 401 ( auth errors) from the twilio webhook. I have checked that my details are correct. and have tried with both my user id and password and Sid and token in th eauth section to no avail
this is what I am using:
{
"eventName": "Switch1Trip",
"url": "https://api.twilio.com/2010-04-01/Accounts/MY TWILIO ACCOUNT SID/Messages",
"requestType": "POST",
"auth": {
"username": "MY TWILIO USER NAME",
"password": "MY TWILIO PASSWORD"
},
"form": {
"From" : "TWILIO_PHONE_NUMBER",
"To" : "MY_PHONE_NUMBER",
"Body" : "Switch 1 tripped"
},
"mydevices": true
}
What do I need to change to get twilio to send the text?
thanks