Hello Community,
i have a question: i want to use the webhook to send upon hitting a button in the blynk mobile app a http post request with a json in the body to “the things network” to make a downlink to my lora device.
the link works, testet it with postman:
that’s the link:
and that is the json body:
{
“dev_id”: “mydevice”,
“payload_raw”: “something”,
“port”: 1,
“confirmed”: false,
“schedule”: “replace”
}
the server only returns 202 “status accepted”
everything is static and needs not to be changed.
webhook running on V0
BLYNK_WRITE(V0) {
Serial.println("WebHook data:");
Serial.println(param.asStr()); // would return the status message from the server (202 accepted)
}
BLYNK_WRITE(V1) { // Webhook button for V1 (styled button in app with push mode)
if (param.asInt() == 1) {
Serial.println("Webhook triggered");
// in widget as PUT: what do i need to insert???
Blynk.virtualWrite(V0, "{\"dev_id\": \"mydevice\",\"payload_raw\": \"something\",\"port\": 1,\"confirmed\": false,\"schedule\": \"replace\"}");
}
}
so, what do i insert in “URL” and “body” in webhook settings? and what needs to be inserted in the
Blynk.virtualWrite(V0,....
part?
i tried several constallations, as suggested in various threads in this forum. please help