# Devices not appearing in Group via API

**URL:** <https://forums.losant.com/t/devices-not-appearing-in-group-via-api/4671>\
**Category:** Help\
**Tags:** groups\
**Created:** [August 1, 2022, 9:57pm UTC](https://forums.losant.com/t/devices-not-appearing-in-group-via-api/4671 "2022-08-01T21:57:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paolo\_Proxy](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Paolo\_Proxy](https://forums.losant.com/u/Paolo_Proxy)\
**Post date:** [August 1, 2022, 9:57pm UTC](https://forums.losant.com/t/devices-not-appearing-in-group-via-api/4671/1 "2022-08-01T21:57:28Z")

</div>

Hi there,  
I can’t figure out what I am doing wrong.  
I have 3 devices.

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

I have added them to a group:

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

But when I call the group info via the API (open for now testing):  
[https://sunderland-test.onlosant.com/api/groups](https://sunderland-test.onlosant.com/api/groups)

I can’t see the devices:

> {  
> “groupTags”: {  
> “Type”: “Sub-contractor”  
> },  
> “name”: “Nomad Installer”,  
> “applicationId”: “62c591186fd751ddcf341521”,  
> “creationDate”: “2022-08-01T17:17:17.529Z”,  
> “lastUpdated”: “2022-08-01T21:48:36.278Z”,  
> “deviceQueryJson”: “{\n "$and": [\n {\n "deviceClass": {\n "$eq": "standalone"\n }\n }\n]\n}”,  
> “experienceGroupId”: “62e80a9dfe41b38464654221”,  
> “id”: “62e80a9dfe41b38464654221”,  
> “parentId”: null,  
> “deviceIds”: [
> 
> ],  
> “deviceTags”: [
> 
> ],  
> “experienceEndpointIds”: [
> 
> ],  
> “experienceUserIds”: [  
> “62e84133a3bfaddbd7a73e18”  
> ]  
> }

It must be something silly but I can’t figure it out.

---

<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:** [August 1, 2022, 10:03pm UTC](https://forums.losant.com/t/devices-not-appearing-in-group-via-api/4671/2 "2022-08-01T22:03:33Z")

</div>

Hello @Paolo_Proxy,

It looks like you’re querying just the metadata for a group, likely using the [Group: Get Node](https://docs.losant.com/workflows/experience/get-group/)?

If you want to get the devices that are associated with a group, you’ll have to use the [Device: Get Node](https://docs.losant.com/workflows/data/get-device/). One of the built-in query types is **Find by Experience Group ID**.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![Paolo\_Proxy](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Paolo\_Proxy](https://forums.losant.com/u/Paolo_Proxy)\
**Post date:** [August 2, 2022, 6:27am UTC](https://forums.losant.com/t/devices-not-appearing-in-group-via-api/4671/3 "2022-08-02T06:27:34Z")

</div>

Hello yes this is what I am using:

> **[Group: Get Node](https://docs.losant.com/workflows/experience/get-group/)**
>
> Learn more about the Group: Get Node.

According to the example the device ids should appear:

```auto
{
  "data": {
    "query": {
      "name": "myGroup"
      ...
    },
    "groupResult": {
      "name": "myGroup",
      "description": "I'm a group",
      "creationDate": "2017-03-30T00:18:23.902Z",
      "lastUpdated": "2017-03-30T00:18:59.019Z",
      "applicationId": "58dc4ec29e8df60001fbea01",
      "groupTags": [{
        "key": "myKey", "value": "val"
      }],
      "deviceIds": ["58dc4ec29e8df60001fbea02"],
      "parentId": null
    }
  },
  ...
}

```

but in my case the field deviceIds is empty.  
Could this be a bug?

---

<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:** [August 2, 2022, 12:55pm UTC](https://forums.losant.com/t/devices-not-appearing-in-group-via-api/4671/4 "2022-08-02T12:55:11Z")

</div>

What you’re seeing is the configuration of the group. Devices can be associated to a group in three ways:

1. By specifying one or more device IDs
2. By specifying one or more device tags
3. Using an advanced query

You used an advanced query, which is why the device IDs and tag properties are blank.

To get the collection of devices associated with a group, you have to use the Device: Get Node.

---

<div class="post-metadata">

**Author:** ![Paolo\_Proxy](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Paolo\_Proxy](https://forums.losant.com/u/Paolo_Proxy)\
**Post date:** [August 2, 2022, 1:29pm UTC](https://forums.losant.com/t/devices-not-appearing-in-group-via-api/4671/5 "2022-08-02T13:29:27Z")

</div>

Ah, I got it now, it wasn’t clear in the documentation. I can see now that the fields are populated as I change the query.
