# Subscribe Tracker to Webhook Response

**URL:** <https://community.particle.io/t/subscribe-tracker-to-webhook-response/62035>\
**Category:** Cloud\
**Created:** [February 13, 2022, 9:55pm UTC](https://community.particle.io/t/subscribe-tracker-to-webhook-response/62035 "2022-02-13T21:55:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbass450](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pbass450](https://community.particle.io/u/pbass450)\
**Post date:** [February 13, 2022, 9:55pm UTC](https://community.particle.io/t/subscribe-tracker-to-webhook-response/62035/1 "2022-02-13T21:55:53Z")

</div>

I’m trying to use a Tracker to connect some BLE devices to my backend over cellular. What I’ve implemented so far works fine, except that I need the Tracker to receive information about the user operating it from my backend. I built a similar system with a Boron a while back and just subscribed to the webhook response, then iterated through the JSON it got back to get the data, and it worked fine. However, the Tracker doesn’t seem to actually subscribe to the webhook response event; the handler I assign to it is never called. I know the event firing the webhook is actually being sent, because it shows up on my backend. The device should receive its information from my backend as soon as it connects to the cloud, so I fire the event that fires the webhook on the first call of loop() after subscribing to the webhook response in setup(); is there a chance some sort of race condition is happening where the response arrives before the subscription is registered?

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [February 14, 2022, 7:28am UTC](https://community.particle.io/t/subscribe-tracker-to-webhook-response/62035/2 "2022-02-14T07:28:52Z")

</div>

You could keep sending the event repeatedly and only stop sending after you successfully received the response (e.g. via a flag set inside the sub handler).

---

<div class="post-metadata">

**Author:** ![pbass450](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pbass450](https://community.particle.io/u/pbass450)\
**Post date:** [February 14, 2022, 8:54am UTC](https://community.particle.io/t/subscribe-tracker-to-webhook-response/62035/3 "2022-02-14T08:54:18Z")

</div>

I just tried this, and even after sending the event several times, the response handler is never called. Earlier I tried waiting until 10 seconds had passed after the device had initially connected to the cloud to send the event, and that didn’t work either. The only two things I can think of that could be an issue here are 1) because the Tracker is in a product, is the syntax for webhook response events different? and 2) is there something that has to be done to the webhook configuration to allow response events to be sent for product webhooks? This is incredibly bizarre behavior; like I said, virtually the exact implementation I’m using now worked with a Boron without any problems, and the Boron was in a product IIRC.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [February 14, 2022, 9:09am UTC](https://community.particle.io/t/subscribe-tracker-to-webhook-response/62035/4 "2022-02-14T09:09:59Z")

</div>

IFAICT even product devices should be able to receive webhook responses they themselves had initiated via a `Particle.publish()` call - otherwise I’d not see a lot of use in `Particle.subscribe()` for these devices at all.

However, it may help if you could show the webhook definition and the related publish/subscribe calls.

But for an official statement we can ping @Colleen

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [February 14, 2022, 1:55pm UTC](https://community.particle.io/t/subscribe-tracker-to-webhook-response/62035/5 "2022-02-14T13:55:54Z")

</div>

By default, Tracker devices are unclaimed product devices. Since they are not claimed to a user account, they cannot receive events. In order to be able to subscribe to events you’d need to claim all of the devices, typically to a single account.

You can use function calls with unclaimed product devices, which is how the configuration service updates are handed.

---

<div class="post-metadata">

**Author:** ![pbass450](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pbass450](https://community.particle.io/u/pbass450)\
**Post date:** [February 15, 2022, 12:40am UTC](https://community.particle.io/t/subscribe-tracker-to-webhook-response/62035/6 "2022-02-15T00:40:10Z")

</div>

That makes much more sense. This sounds like a dumb question, but how would I claim the device to a user account? I now see in its page on the console that the owner is given as ‘unowned’, but I don’t see a place to add an owner.

---

<div class="post-metadata">

**Author:** ![pbass450](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pbass450](https://community.particle.io/u/pbass450)\
**Post date:** [February 15, 2022, 2:57am UTC](https://community.particle.io/t/subscribe-tracker-to-webhook-response/62035/7 "2022-02-15T02:57:26Z")

</div>

Just did some poking around and found how to claim through the CLI; everything works as it should now.

For posterity: [Device Claiming | Tutorials | Particle](https://docs.particle.io/tutorials/device-cloud/device-claiming/#how-do-i-claim-a-device-)

It would have been very helpful to me if this had been made a note in the documentation for subscribing in the Device OS API or in the tutorial on using custom firmware with the Tracker. Thanks!

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [February 15, 2022, 12:39pm UTC](https://community.particle.io/t/subscribe-tracker-to-webhook-response/62035/8 "2022-02-15T12:39:39Z")

</div>

Done. It’s now mentioned in the [Tracker Edge firmware tutorial](https://docs.particle.io/tutorials/asset-tracking/tracker-edge-firmware/#subscribing-to-events) and also the [Particle.subscribe](https://docs.particle.io/cards/firmware/cloud-functions/particle-subscribe/) documentation.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/3/2/3291e3c9351789fe8620ae5bcec8d3fec67ff221.png) [@system](https://community.particle.io/u/system)\
**Post date:** [March 17, 2022, 10:40pm UTC](https://community.particle.io/t/subscribe-tracker-to-webhook-response/62035/9 "2022-03-17T22:40:26Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
