I am a new user of the Particle and I created a webhook to get some information from an api which gives real-time schedule of a bus at a certain stop. Here is the url I used in the webhook:
The raw data returned is in JSON format:
{
"bustime-response": {
"prd": [
{
"tmstmp": "20180129 18:41",
"typ": "A",
"stpnm": "Fifth Ave at Craig St (nearside)",
"stpid": "1174",
"vid": "5372",
"dstp": "3170",
"rt": "71D",
"rtdd": "71D",
"rtdir": "OUTBOUND",
"des": "HAMILTON WILKINSBURG",
"prdtm": "20180129 18:47",
"dly": "false",
"dyn": "0",
"tablockid": "071D-196",
"tatripid": "10760",
"prdctdn": "5"
},
{
"tmstmp": "20180129 18:41",
"typ": "A",
"stpnm": "Fifth Ave at Craig St (nearside)",
"stpid": "1174",
"vid": "5663",
"dstp": "22967",
"rt": "71D",
"rtdd": "71D",
"rtdir": "OUTBOUND",
"des": "HAMILTON WILKINSBURG",
"prdtm": "20180129 19:11",
"dly": "false",
"dyn": "0",
"tablockid": "086 -306",
"tatripid": "10764",
"prdctdn": "29"
}
]
}
}
I use a response template to get the value of “prdctdn” in the first array, which is
{{bustime-response.prd.0.prdctdn}}
But in the Event of the console, the hook response is like:
{"data":"\n ","ttl":60,"published_at":"2018-01-30T00:14:07.523Z","coreid":"particle-internal","name":"hook-response/busgazer/0"}
Apparently it is not the data I want. I have no idea how to solve this problem, am I using a wrong response template?