Events, public vs private

So I’m seeing some weird stuff using two products. Argona and Boron.

I publish an event to product id for the boron product and the Argon responds.

Does it matter if I set public vs private on the event? and How does that change what devices and products get that event?

When I send events to https://api.particle.io/v1/devices/events it triggers all devices and when I send events to https://api.particle.io/v1/products/‘.$productid.’/events’ it does the same thing.

Why is that, and is there a way to separate product event streams?

I did set private to true on both of these publishes.

There haven’t been public events since August 2020.

If you publish to https://api.particle.io/v1/devices/events it publishes to all devices claimed to the account whose access token the requester is using.

If you publish to https://api.particle.io/v1/products/:productid/events’ since March 2023, it publishes to all devices in :productid, regardless of claiming, including unclaimed product devices.

2 Likes

So why is it going to other product event steams when I use https://api.particle.io/v1/products/:productid/events’?

Maybe there is a way to use a special token or something to separate the product event streams?

It stopped doing this today, I have no idea why. Weird.

Nope never mind, still doing it.

I have two different products and they are both responding to the same events published on one of the other products. Is this normal?

Normally when you publish an event (non-product), the access_token owner determines which devices(s) the event will go to based on their claimed account.

What I think is happening is that when you publish to the product event stream, it’s sending to the union of the product and the devices claimed to the access_token.

It should be easy enough to test this by generating an access token for a user other than the account that claimed the devices, which presumably is your account. Using an API user (per product), or a different team member token, would be one way to test this.

Or you could temporarily unclaim the devices and use them as unclaimed product devices and see if that solves the problem.

That worked, I created a team account and used the web app token creation tool here to make a non expiring token.

Thank you!