Get list of all users who have access to a device within an experience

I’m working on a notification system for our experience users and would like to trigger on demand event notifications. Everything is working as expected expect I can’t quite figure out how to get a list of users who have access to a device.

My workflow strategy has been:
on event trigger -> get event via relayId -> get device via deviceId returned from event -> get group via device tags returned.

What I now want to do is return all users associated with that group, which I can then loop on to see if they have “on-demand” notifications enabled within our experience, and if so, shoot out an event notification.

Any insight on how to get this user list, or perhaps a better way to accomplish this would be greatly appreciated.

Relevant Application: 5e7286195864100006e80f35/
Relevant Workflow: 5f15d1a1c6e3ca00072d9010

Hi @Zach_Jacobs,

Thanks for this description of your use case, it was quite helpful. :smile:

I found some resources that may provide guidance and walkthroughs, and are quite relevant because they describe similar architecture:

Currently, there are a couple of ways to produce this list, and if you are using the Group: Get Node, it’s possible you may already have it! I would recommend reading the above posts however, to see how these work in context, as the following will only provide the users in that group, and not users nested below.

  • Since you are querying by tag in the Group: Get Node, your result should include an array of experienceUserIds.
  • You can get Experience Users with the Losant API Node and the Groups GET resource.
  • Keep in mind you also have the option of storing the group as a tag on the user and using a tag query in the Get User Node to return a list.

Please let me know if you have any additional questions!

Nice thanks. That seems to do the trick for single levels, but is there an easy way to also get users higher up the search tree that have access to the device via being a member of a parent group?

Hi @Zach_Jacobs,

Unfortunately, yes, this is a bit more difficult to configure. However, I have created a Feature Request for this functionality and will follow up should it be implemented in the near future.

In the meantime, this question was also discussed in these forum posts, perhaps they can also provide some guidance on creating your tenancy logic:

Thanks so much,