# Unknown Connection Status using webhooks

**URL:** <https://forums.losant.com/t/unknown-connection-status-using-webhooks/378>\
**Category:** Help\
**Tags:** webhook\
**Created:** [January 16, 2017, 9:56am UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378 "2017-01-16T09:56:44Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Preben\_Dyrholm](https://avatars.discourse-cdn.com/v4/letter/p/eb8c5e/32.png) [@Preben\_Dyrholm](https://forums.losant.com/u/Preben_Dyrholm)\
**Post date:** [January 16, 2017, 9:56am UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378/1 "2017-01-16T09:56:44Z")

</div>

I currently have a few Particle Photon-based devices reporting their state using webhooks to my application. This is mostly working fine, although my devices end up with an unknown connection status.

Is there any way for me to update their connection status manually?

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [January 16, 2017, 5:05pm UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378/2 "2017-01-16T17:05:29Z")

</div>

Currently the device connection indicator is tied to the MQTT connection state. We’re seeing lots of users connecting and reporting in ways other than MQTT, like your use-case. We’ve made it a priority to re-think how connection is reported so we can better display the status. The ability to update via the API makes a lot of sense - I’ve created a ticket to expose that functionality.

---

<div class="post-metadata">

**Author:** ![Alan\_Chan](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/alan_chan/32/413_2.png) [@Alan\_Chan](https://forums.losant.com/u/Alan_Chan)\
**Post date:** [November 6, 2017, 4:12pm UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378/3 "2017-11-06T16:12:58Z")

</div>

This was the first posting I saw when searching for this issue. Is there any update to this? Will keep looking. I am having the same issue. Get connections via webhook, but does not update device log.

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [November 7, 2017, 9:35pm UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378/4 "2017-11-07T21:35:02Z")

</div>

Are you connecting to the Losant MQTT broker using websockets? If so, those connections should show up in the connection log.

---

<div class="post-metadata">

**Author:** ![Alan\_Chan](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/alan_chan/32/413_2.png) [@Alan\_Chan](https://forums.losant.com/u/Alan_Chan)\
**Post date:** [November 7, 2017, 10:02pm UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378/5 "2017-11-07T22:02:31Z")

</div>

I’m just using a webhook and going through the flow from there (SigFox backend calls the webhook). Maybe I could make a webhook that feeds the MQTT broker first? Then re-retrieve it from MQTT then process it via workflow. It’s a little convoluted but seems like it would work.

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [November 7, 2017, 10:17pm UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378/6 "2017-11-07T22:17:35Z")

</div>

Oh, apologies. I misread the previous topic as “websockets” instead of “webhooks”.

This is still something we haven’t got a clean solution for. Device connection status is still directly tied to MQTT connections. When using Sigfox and other connectivity providers, the connection status won’t update. Since external providers are becoming more popular, this is something that’s high priority for us to address.

---

<div class="post-metadata">

**Author:** ![tirosh\_gutte](https://avatars.discourse-cdn.com/v4/letter/t/d2c977/32.png) [@tirosh\_gutte](https://forums.losant.com/u/tirosh_gutte)\
**Post date:** [May 6, 2020, 3:52pm UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378/7 "2020-05-06T15:52:08Z")

</div>

Any update on the ability to log arriving webhooks?  
Basically how can we trend incoming webhook with respect to:

1. Time the webhook payload arrived (building a historian for the time the webhooks arrived)
2. Webhook content quality tool (i.e. payload content keys count)

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [May 7, 2020, 4:22pm UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378/8 "2020-05-07T16:22:01Z")

</div>

@tirosh_gutte,

There are three methods if you would like to log arriving webhooks ( or log workflow payloads in general).

**As a Device**

If you want this data on a Losant Dashboard, it has to be reported as [device state](https://docs.losant.com/devices/state/). You can make a device that represents the “Webhook”. Devices in Losant can be anything. You can treat your “Webhook” or “Workflow” as a device and store the different metrics ( counts, data ) you want as attributes on that device. Depending on how much data you generate, I would be mindful of [payloads](https://docs.losant.com/organizations/resource-limits/#payload-limits).

**Data Table**

Before I start, Data Tables should not be used for time-series data. Mostly because [aggregations](https://docs.losant.com/references/aggregations/) are not supported on Data Table values.

But, if you were only logging a couple of times a day, [Data Tables](https://docs.losant.com/data-tables/overview/#when-to-not-use-data-tables) could work. Data Tables have [limits](https://docs.losant.com/data-tables/overview/#data-tables-limit) too.

**Third-Party Service**

Any logging service, such as [Loggly](https://www.loggly.com/) or [Data Dog](https://www.datadoghq.com/), can be used to store a history of your workflow payloads.

Happy to dig in further and answer more questions!

---

<div class="post-metadata">

**Author:** ![tirosh\_gutte](https://avatars.discourse-cdn.com/v4/letter/t/d2c977/32.png) [@tirosh\_gutte](https://forums.losant.com/u/tirosh_gutte)\
**Post date:** [May 7, 2020, 5:04pm UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378/9 "2020-05-07T17:04:19Z")

</div>

**As a Device** make most Sense

1. Created a new device in losant and labeled it Webhook Logger
2. Added it to the workflow under webhook reply  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/e/ece14c6ab1af726c755567ee399667903302f397.png)
3. Built a dashboard with a time series graph block with the following criteria:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/1/1f2de6db8cfb9ea96a5a0cbc06be9f0f5230b0b1.png)

Are there any intermediate steps I am missing here? So far I can not seem to populate the payload count?

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [May 7, 2020, 5:48pm UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378/10 "2020-05-07T17:48:17Z")

</div>

@tirosh_gutte,

Can you please screenshot the section of the Device: State Node’s setting called “State”?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/2/240d55cdc3916eccbf9332d93934f9f4f425bf95.png)

---

<div class="post-metadata">

**Author:** ![tirosh\_gutte](https://avatars.discourse-cdn.com/v4/letter/t/d2c977/32.png) [@tirosh\_gutte](https://forums.losant.com/u/tirosh_gutte)\
**Post date:** [May 7, 2020, 5:58pm UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378/11 "2020-05-07T17:58:59Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/6/6405e831593ddaaa7381c4c063217f1b39423a19.png)

The payload look like similar to this:  
{  
“globals”: {},  
“applicationName”: “—”,  
“flowName”: “—”,  
“flowId”: “—”,  
“flowVersion”: “—”,  
“relayType”: “—”,  
“relayId”: “—”,  
“triggerType”: “—”,  
“triggerId”: “—”,  
“applicationId”: “—”,  
“data”: {  
“replyId”: “—”,  
“body”: {  
“time”: “2020-04-29T17:42:50.981Z”,  
“data”: {  
“path”: “/”,  
“method”: “post”,  
“headers”: {},  
“query”: {},  
“body”: null,  
“replyId”: “—”  
},

},  
“time”: “2020-05-07T18:00:01.056Z”  
}

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [May 8, 2020, 1:21pm UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378/12 "2020-05-08T13:21:01Z")

</div>

I did see this in your payload:

> [@tirosh\_gutte](#):
>
> “body”: null,

It looks like body is null. Is that correct?

Also, is this payload path correct: `{{data.body.data.[153002].[analog-value:21` (cut off from screenshot)? Could you point me to where the data exists on the payload in the Debug Panel?

---

<div class="post-metadata">

**Author:** ![tirosh\_gutte](https://avatars.discourse-cdn.com/v4/letter/t/d2c977/32.png) [@tirosh\_gutte](https://forums.losant.com/u/tirosh_gutte)\
**Post date:** [May 8, 2020, 2:52pm UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378/13 "2020-05-08T14:52:43Z")

</div>

Correct, the body currently does not have content.  
I just want to log the incoming webhooks, no interest in the body content at this stage, just want to verify the body section is arriving.  
What attribute/value payload path should I select in order to count the incoming webhooks body section?

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [May 11, 2020, 2:09pm UTC](https://forums.losant.com/t/unknown-connection-status-using-webhooks/378/14 "2020-05-11T14:09:04Z")

</div>

@tirosh_gutte,

This is specific to your application. However, you could have a boolean attributes called `hasBody` and report a one or zero when you see body. This is because the presence of the body is important. This would give you a devices that represents the history of request and you’ll be able to see if those requests had a body or not.

If you want to store other attributes about your webhook, they just have to be one of the following types:

> **[Device Attributes](https://docs.losant.com/devices/attributes/#attribute-data-types)**
>
> Learn about device attributes and how they are used in the Losant Platform.
