Having the webhook:
{
"eventName": "get_connections",
"url": "http://transport.opendata.ch/v1/connections?from=Basel&to=Bern&fields[]=connections/from/departureTimestamp&limit=6",
"requestType": "GET"
}
I receive an escaped JSON-String:
got json:"{\"connections\":[{\"from\":{\"departureTimestamp\":1426109220}},{\"from\":{\"departureTimestamp\":1426110120}},{\"from\":{\"departureTimestamp\":1426111020}},{\"from\":{\"departureTimestamp\":1426111920}},{\"from\":{\"departureTimestamp\":1426112820}},{\"from\":{\"departureTimestamp\":1426113720}}]}"
Code snippets:
Spark.subscribe("hook-response/get_connections", gotConnectionData, MY_DEVICES);
//...
Spark.publish("get_connections");
//...
void gotConnectionData(const char *name, const char *data) {
Serial.println("got webhook data for connections");
String str = String(data);
Serial.print("got json:");
Serial.println(jsonData);
}
As a result, my json parser can not interpret the result. Is this an error on my side or with the webhooks?