Webhook error connect ECONNREFUSED


#1

Hi,

I created a webhook integration to send data from the particle board to our private cloud, however I always get the following error: “connect ECONNREFUSED”, while testing the integration from https://console.particle.io/integrations/webhooks/

Our HTTP REST API works great, it has been tested and it is operational receiving data form other sources, however, my tests from Particle Console keeps failing.

I have disabled the injection of the additional fields, and disabled forcing SSL, nothing makes it work.

Would you know what usually could cause that error?

This is exactly what I have in my JSON field:
{
“avgSnr”: “33.33”,
“duplicate”: false,
“lat”: “44.44”,
“lng”: “55.55”,
“networkAssetCode”: “17AB05”,
“payload”: “48;27;1005;24.10;81.234”,
“rssi”: “22.22”,
“seqNumber”: 4,
“srn”: “11.11”,
“station”: “27CE”,
“time”: 1488933651
}

Thank you!


#2

Do you have a long response time from the HTTP endpoint?


#3

No, very fast!


#4

You might want to show us a screenshot of the webhook or setup a test webook with https://requestb.in to figure out what might be the issue.


#5

Hi Kennethlimcp,

This is the result of the requestb.in:

It worked, however how can that help me to know what is the requirement for the integration to work from a web method perspective?

This is my REST API:

@POST
@Path("push")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response assetUpdate(Asset asset) {

    System.out.println("Received API Call: assetUpdate");

    DBInterface aDAO = new DBInterface();
    int dbResponse = aDAO.updateAsset(asset.getNetworkAssetCode(), asset.getSeqNumber(), asset.getTime(),
            asset.getPayload(), asset.getTemperature(), asset.getHumidity(), asset.getPressure(),
            asset.getAssetLat(), asset.getAssetLng(), asset.getDuplicate(), asset.getSrn(), asset.getRssi(),
            asset.getAvgSnr(), asset.getStation(), asset.getLat(), asset.getLng());

    if (dbResponse != -5) {
        return Response.ok(200).build();
    } else {
        return Response.ok(484).build(); // something went wrong while inserting data into db
    }

}

Thank you again!


#6

Can you look at the raw hook/response event at https://console.particle.io/logs and see what is the error message for connecting to your server?


#7

Issue was resolved by restarting the service in our server, not sure why…