Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Webhooks in Adafruit IO for Twilio possible?
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Webhooks in Adafruit IO for Twilio possible?

by biod101 on Mon Aug 17, 2020 2:23 am

Hello,

I am currently using a Particle Boron to post data to an Adafruit IO feed. When something interesting happens on the Particle side, I'm able to call a webhook from within my Particle code that posts a JSON message with username, password, and additional details for sending a text to my cell phone.

In order to call that webhook, I need to configure the same via the Particle IO "Integration" option. The integration gives the webhook a name that I can then call from within my code. This works great, and I've included a screenshot below shows what a configuration for a webhook called "Sutter" looks like, with some confidential details hidden:

Slide1.jpeg
Slide1.jpeg (60.87 KiB) Viewed 47 times


It looks like Adafruit IO gives me similar functionality through triggers which allows me to similarly use a webhook to post a JSON message, but I can't figure out how to code the associated options in the circled part of this screenshot - I keep getting errors when I copy/paste the associated values from the sample code provided by the Particle web hook integration shown in the first image above.
:
Slide2.jpeg
Slide2.jpeg (111.65 KiB) Viewed 47 times


The reason I want to do this from within Adafruit IO is I don't want to be married to the Particle platform for this functionality (I have other platforms I'm working with.) Before I continue burning time on this, I just need to know if it's possible to call on Twilio to text me a message using a reactive webhook from within Adafruit IO. Any suggestions on what I should include in that block based on the functioning webhook and code from my Particle IO integration?

PS - I know I can do this using Zapier, but I've found that platform relatively expensive for the needs of my organization, so I'm trying to find a workaround.

Thank You.

biod101
 
Posts: 135
Joined: Sun Apr 19, 2015 4:21 pm

Re: Webhooks in Adafruit IO for Twilio possible?

by jwcooper on Mon Aug 17, 2020 11:35 am

Without knowing what you would need the values to be, an example of formatting would be:

Code: Select all | TOGGLE FULL SIZE
{
  "From": "biod101",
  "To": "twiliophonenumber",
  "Body": "{{value}}"
}


The issue here is that we currently do not support http basic authentication with our webhooks. We'll add it to our list as maybe an advanced/optional feature to support, but will need to check how common this is for various application webhook endpoints, and if they are formatted similarly.

jwcooper
 
Posts: 692
Joined: Tue May 01, 2012 9:08 pm

Re: Webhooks in Adafruit IO for Twilio possible?

by biod101 on Mon Aug 17, 2020 12:05 pm

Thanks for the fast reply.

I'm not a programmer, so I'm assuming your response is in regards to the fact that I need to share a username and password in my post if I want Twilio to follow through on the text as is done with the Particle web-hook integration (?).

Anyway, it would be great if you could support this functionality since it would really open up some possibilities via Adafruit IO. For example, as a customer of RockBlock who manages ten satellite modems, I've already asked Rockblock to have their servers support posting data to Adafruit IO in order to help us migrate away from Thingspeak. They've indicated they are working on it, but if I can't send an SMS text from Adafruit IO in a cost-effective manner, then integrating RockBlock satellite modems will only get me half way there.

Thanks for your consideration.

biod101
 
Posts: 135
Joined: Sun Apr 19, 2015 4:21 pm

Please be positive and constructive with your questions and comments.