Trouble with "your first webhook" weather example [Fixed]

I am trying to replicate the the weather example from the webhook doc page (http://docs.spark.io/webhooks/) but something’s going wrong. PS I’m a beginner so go easy please. :smile:

Using the CLI I entered this command (copied and pasted from the example page)

spark webhook GET get_weather http://w1.weather.gov/xml/current_obs/KMSP.xml

This doesn’t work. I just get a list of commands I can try instead of the success message. I assume that’s because it’s missing the “create” command, right? What am I doing wrong?? Thanks!

looks like a typo...

spark webhook create get_weather http:/.....

probably need to fix the docs... @BDub??

EDIT, well I made a typo too!

Yep, looks like that did it. :smile:

The “GET” command is brand new! Make sure you’re using the latest version of the spark-cli with:

npm update -g spark-cli

hmm, I’m not seeing this deployed like I expected… checking…

edit: looks like this was left out of the CLI, my mistake! I’ve pushed those commands, and hopefully we’ll have an update deployed soon. Sorry about that!

Thanks!
David

While you are waiting for the updates to make it to the Spark CLI, you can emulate this line:

spark webhook GET get_weather http://w1.weather.gov/xml/current_obs/KMSP.xml

With this one

spark webhook create weather.json

And this JSON file

##weather.json

{
    "eventName": "get_weather",
    "url": "http://w1.weather.gov/xml/current_obs/KMSP.xml",
    "requestType": "GET",
    "mydevices": true
}

Thanks @BDub this is awesome. For some reason now I’m receiving a timeout message no matter how I try to create the webhook. Is there something wrong with the service?

Something went wrong, server said:  Timed out

More and more I think I might have gotten myself blacklisted here. I can’t create new webhooks and the ones I made a few days ago have stopped returning data reliably. ( See: https://community.spark.io/t/webhook-callbacks-unreliable-atm/10633 )

When I implemented my first webhook I accidentally called the hook every loop while the data wasn’t set. :astonished:

Would that have gotten me banned? :neutral_face:

didn't realize you'd cross-posted...

I don’t think you can get blacklisted… that’s what rate limiting is for. It prevents you from being bad. That said, try to be good! :smile:

We’re looking into these issues. Try to create the webhook again though. It should eventually be successful or give you an error, not timeout.