Webhooks + Sending a text message

Hey all -

Loved the recent announcement of webhook support, and couldn’t wait to go try out an integration. Integrating with an external API is incredibly simple; I’ve documented the process in the following post:

http://www.starkiller.net/2015/03/10/twilio-spark/ dead

Disclaimer: I work for Twilio and thus was fairly familiar with the API, but the process I describe is applicable to most external web API providers.


Awesome! Thanks for sharing @hoxworth ! Can’t wait to integrate text messaging into my projects at home :slight_smile:


@hoxworth, just one minor item. At then end, the call to the Spark.function() is:

$ spark call DEVICE_ID sendMessage

I believe it should be:

$ spark call DEVICE_ID sendSMS

Thanks for the great work! :smile:


Ack thanks! That will teach me to cut and paste from my code rather than something I pre-formatted. Since I was sending an MMS I didn’t like the SMS function name… blargh. Fixed!


Thanks for sharing this walkthrough, @hoxworth! I might tinker with trying to replicate this process with Sheetsu (https://sheetsu.com/) this coming weekend. I want a slightly more passive method of checking the status of a sensor for a project I’m working on, so a Google Spreadsheet makes the most sense for my project. If I’m successful (however unlikely) I’ll share back the changes I make to your code!

Hi, the above link doesn't seem to work, can you please advice where I can find the example.

1 Like

@Falcon : In case you just need an example to send a twilio text from photon, here's what I use:

the webhook code:

    "eventName": "twilio",
    "url": "https://api.twilio.com/2010-04-01/Accounts/AccountSid/Messages", //replace AccountSid with your own
    "requestType": "POST",
    "auth": {
        "username": "Ba78453209dea6548777777", //twilio AccountSid, same as above
        "password": "cd78a653456464646464646abf" //twilio AUTH
    "form": {
        "From" : "+19999999999", //your twilio number
        "To" : "+18888888888",  //recipient's number
        "Body" : "{{SPARK_EVENT_VALUE}}"
    "mydevices": true

and this is my photon code:

Particle.publish("twilio", textMSG, 60, PRIVATE);

1 Like

@hoxworth the link is not working, can you please provide another alternative?

Hello! Following up to swapn’s comment, I would also like to know if there is a working link that someone is aware of for hoxworth’s tutorial? I’m really interested in learning how to integrate twilio’s API with a photon.


I am attempting to get sending an SMS working with an Electron via Twilio.

The Dec '15 example in this thread works fine. But I want to use a variable as the “To” field for sending the SMS. The above example uses a fixed value for the ‘To’ field. I have tried many combinations,and can’t get a variable to work. I always get a 400 error back from Twilio.

2 posts were merged into an existing topic: Water Tank Sensor