Webhook post request body problem!

Hi everybody,

I try to get the pin value in web hook but I got problem with it. From device, I write Blynk.virtualWrite(V9, humidity_int); and I use webhook to post that value to a another database. In Web hook App , I use POST body request (apllication/json) , I wrote : {“hum”: ["/v9/"]} .The request has been sent to the data base with value is 0 so I guess may be the format have something wrong cause when I use display App , the value is there around 30 ?! So have anybody tried with it and know how to get the pin value correctly ? If I replace the pin with constant value , it works just fine !

Thanks in advance,

1 Like

Hello.

Should be {“hum”: ["/pin/"]} I guess

@Dmitriy So should it be just like my format {“hum”: ["/v9/"]} ? If it is then it’s not working yet , I have tried many ways so If you can write it exactly with the pin , it would help me a lot …

What is your database API format?

@Dmitriy It will be like this:
Method: Post
Url: http://test.com/api/Data.php
(just example url and I use Postman to post with it already so you can trust me that the url is fine )
Content type: application/json
Body example:
{
“temp”:“58”,
“hum”:“19”
}

That is all, it works with Postman so I wonder why can not work with webhook, I guess I got wrong pin format ?
I want to get some values to my database to do some calculation with it !

Ok, so why do you send array and not single value?

{“hum”: "/pin/"}

@Dmitriy what do you mean array, I just want to send single value from pin like this {“hum”: ["/v9/"]} as same as {“hum”: "33"} for example… that why I wonder what is the correct format for the pin , I may get it wrong ?

[“1”] - array
“1” - single value

@Dmitriy That what I though also so I did change to {“hum”: "/v9/"} but it didn’t work , so you got any other ideas ?

Did you try this?

@Dmitriy Do mean this {“hum”: “/v9/”} ? Then I have tried. Could you write more exactly cause I have also tried this {“hum”: “/pin[9]/”} but it doesn’t work either …

In case your still struggling: It’s confusing perhaps, but you should take Dimitri’s post literally: do not use /V9/ but /pin/. The actual pin is defined earlier in the creation of the webhook.

2 Likes