Problem with spark function & IFTTT

Investigating my isses IFTTT side, they informed me that I had a timeout issue:

Looks like the issue is “Request Timed Out” on the @spark_io side, check in with them on that front!

Channel is active… Other recipies work with my Spark account (using twitter with my message torch).

Can anyone assist? Recipe ID: 21836583

Hi @BulldogLowell

How big is the AlertBody when you get an MLB alert? A function can only take 63 character Strings as input.

@bko

right, lemme try it tomorrow and send only the TeamName ingredient as below. When I get mms, it is generally less than 63, but some are more… Maybe I just need to develop a webhook for scores instead. Do you happen to know of a good example of someone parsing JSON webhook? I searched and cannot find one here. Meanwhile, I can just try XML.

Hi @BulldogLowell

I think there maybe some new features coming that will help you parse the returned data to your webhook in the Spark cloud so your core has to do less work. Coming soon!

It will be a good test to try a known small string.

And Go Sox!

1 Like

I’m not sure what you mean with “parsing JSON webhook”.
But if you want to parse a JSON provided to the Core by your webhook, these might help


1 Like

@ScruffR, there is actually a new webhook feature that @Dave very recently deployed a new JSON parsing webhook capability. So if the webhook normally returns a large JSON payload, you can specify a parsing filter in the webhook to only return specific data. The parse is based on Mustache. For example, a 7 day forecast from openweather.json normally returns a 2K payload which would have to be parsed on the Core. With the new capability, you can get the temperature for all 7 days (and some other data) in less than 200 bytes! So the Cloud does all the p :stuck_out_tongue: arsing work!

4 Likes

great!! I’ve been using XML parsing because for me, it is easier to code (without having to do a lot of work on a library). Having the access to “Cloud-based Spark JSON parsing” is huge. The JSON returns I see from ESPN and other sports score info services are very lengthly and have many levels of data.

thanks guys!

:+1:

2 Likes

How could I’ve missed this :stuck_out_tongue_closed_eyes:

That’s good to know :+1:

1 Like

@ScruffR, it is too new for you to know! @Dave is working on docs and I tested with with the openweather api with great success!

5 Likes

Here is the webhook I used for my openweather project:

{
"eventName": "openweather",
"url": "http://api.openweathermap.org/data/2.5/forecast/daily",
"requestType": "POST",
"headers": null,
"query": {
	"q": "Ottawa,ON",
	"mode": "json",
	"units": "metric",
	"cnt": 7
	},
"responseTemplate": "{{#list}}{{temp.day}}{{#weather}}~{{id}}~{{main}}~{{/weather}}{{/list}}",
"json": null,
"auth": null,
"mydevices": true
}

Notice the response template. Out of the 7day forecast, it extracts just the day temperature, the ID and the condition (cloudy, snow, etc,). Easy, peasy! :stuck_out_tongue:

8 Likes