Particle Cloud Webhook doesn't send data correctly

Hi all,

I’m try to forward the device name, using a webhook to thingsboard. The device name is send by the Argon which it got earlier using the cloud. (Particle.subscribe("particle/device/name", handler);)

It all works fine. The data is correct on the Argon and also arrives correct in the cloud/event.

This is my data json file from the argon code:

  String  payload = "{";
          payload += "\"devName\":";     payload     += devName_S;           
          payload += "}";

Event in the webhook:

  "name": "Webhook",
  "data": "{\"devName\":Argon64002}",
  "ttl": 60,
  "published_at": "2019-05-08T15:52:00.560Z",
  "coreid": "XXXXXXXXXXXXXX"

Error response in the webhook:

HTTP/1.1 500 

X-Content-Type-Options: nosniff

X-XSS-Protection: 1; mode=block

Cache-Control: no-cache, no-store, max-age=0, must-revalidate

Pragma: no-cache

Expires: 0

X-Content-Type-Options: nosniff

Content-Type: application/json;charset=UTF-8

Transfer-Encoding: chunked

Date: Wed, 08 May 2019 15:52:01 GMT

{"cause":null,"stackTrace":[{"methodName":"validateDataImpl","fileName":"","lineNumber":376,"className":"org.thingsboard.server.dao.device.DeviceServiceImpl$2","nativeMethod":false},{"methodName":"validateDataImpl","fileName":"","lineNumber":348,"className":"org.thingsboard.server.dao.device.DeviceServiceImpl$2","nativeMethod":false},{"methodName":"validate","fileName":"","lineNumber":56,"className":"org.thingsboard.server.dao.service.DataValidator","nativeMethod":false}, **... and a lot more**

Data in thingsboard from the data converter:

and also the json format I want to send using the webhook:

  "devName": "{{{devName}}}"

I have no Idea why there is no data send. If I change the devName to the temperature I also want to send, everything is working as expected…

Any hints?

Regards, Tim

Your payload published by the device is not valid. The devName_S must also be surrounded by double quotes.

String  payload = "{";
payload += "\"devName\":\"";     
payload     += devName_S;           
payload += "\"}";

It should look like this in the console:

"data": "{\"devName\":\"Argon64002\"}",
1 Like

Thank you alot. It worked!

1 Like