Looking for example webhook to push published data to ubidots

Does anyone have a working example webhook that sends published data to ubibots ?

The goal is to take variables that are published by a core/photon and currently show up in the dashboard and send them to ubidots (I’d use librato like the example in the docs, but they only have a 30-day eval…)

I have a variable created in ubidots ready to receive the data.

1 Like

Hey @AndyW,

Would this work?

@AndyW

We can provide our glowfi.sh example webhook for you. @josec should be able to send you the code.

Mike

@michaelT & @josec, I look forward to that. I’ve re-written my publish to export a single json payload that contains the values I want to report, since that’s the approach used in the example @Moors7 pointed me at (thanks for that too), but I’ve not had the time to get that working posting to ubidots yet.

@andyw - we’re actually posting data to ubidots in 3 different ways:

  1. using the custom particle endpoint created by @aguspg mentioned by Moors7 above. This automatically creates the data source and variables.

  2. a particle webhook posting to the ubidots variables endpoint:

     {
     "event": "probability_prediction",
     "url":
    

    http://things.ubidots.com/api/v1.6/variables//values”,
    “headers”: {
    “X-Auth-Token”: “”
    },
    “requestType”: “POST”,
    “mydevices”: true,
    “json”:
    {“value”: “{{probability_prediction}}”}
    }

  3. A direct HttpClient post instead of spark.publish as in this example. We have been seeing some dropped webhooks so are testing out a direct http post from the device.

Thanks for this.

I’m planning to push the data via: publish -> webhooks -> ubidots, because it’sthe right way to do it, and I want to eat our own dogfood until that datapath is reliable. IMO it is the correct way to do it, since the data can be consumed by multiple actors as a result of the simple publish from the device.
For instance, I can use IFTTT to send a SMS/email if a value crosses a threshold.

I’ll try these things out and report back.

@andyw I love the power of particle’s pub/sub ecosystem, but I also like having httpclient as an option when we run in to issues like rate limits, payload size limits, system state, etc. Both are great.

1 Like