Ok I'm at my whits end here...
I'm trying to send a webhook with json data.
The webhook json is defined as follows:
{
"type": "{{type}}",
"sub_type": "{{sub_type}}",
"alert": "{{alert}}",
"data": "{{data}}"
}
the "data" part is a nested JSON object: example:
{"amount" : 3.3, "scheduled" false}
(the nested object changes what it sends based on where/when in my code it gets sent)
I've also tried formatting the webhook like this:
{
"type": "{{type}}",
"sub_type": "{{sub_type}}",
"alert": "{{alert}}",
"data": "{{{data}}}"
}
Here's the String I'm sending:
String mess = "{\"type\":1,\"sub_type\":7,\"alert\":true,\"data\":{\"amount\":3.3,\"scheduled\":false}}";
The console says it sent:
{"data":"{\"type\":1,\"sub_type\":7,\"alert\":true,\"data\":{\"amount\":3.3,\"scheduled\":false}}","ttl":"60","published_at":"2016-06-29T17:13:07.195Z","coreid":"2d0020001547343339383037","name":"ahomeevent"}
My server keeps sending me an error saying it's missing the BEGIN_OBJECT
"Expected BEGIN_OBJECT but was STRING at line 1 column 51 path $.data"