cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
houseonthehill
Engaged Sweeper

I have some iPads, iPhones and some other mobile devices in my Lansweeper, which I can see via the Lansweeper portal online. However, when I try to retrieve this data via the API I cannot see fields with information in it although the assetResources total is showing as 6, which to me looks like it is found them but not able to display any information for them.

My query to the API using graphql looks like this,

query getAssetResources {
  site(id: "<id>") {
    assetResources(
      assetPagination: {
        cursor: "<cursor>"
        limit: 50
        page: NEXT
      }
      fields: [
        "assetBasicInfo.name"
        "assetBasicInfo.ipAddress"
        "assetBasicInfo.domain"
        "assetBasicInfo.userName"
        "assetCustom.contact"
        "assetCustom.department"
        "assetCustom.deviceVersion"
        "assetBasicInfo.type"
        "assetCustom.model"
        "assetCustom.purchaseDate"
        "assetCustom.manufacturer"
        "assetCustom.softwareVersion"
        "operatingSystem.caption"
        "assetBasicInfo.lastSeen"
        "assetCustom.stateName"
        "assetCustom.warrantyDate"
        "assetCustom.serialNumber"
        "assetCustom.sku"
        "systemProducts.uuid"
        "assetCustom.department"
        "computerSystems.systemType"
        "operatingSystem.registeredUser"
        "operatingSystem.annotatedAssetId"
        "mobileDeviceManagement.model"
        "mobileDeviceManagement.manufacturer"
        "mobileDeviceManagement.userDisplayName"
        "mobileDeviceManagement.userId"
        "mobileDeviceManagement.deviceName"
        "mobileDeviceManagement.operatingSystem"
        "mobileDeviceManagement.osVersion"
      ]
      filters: {
        conjunction: AND
        conditions: [
          { operator: LIKE, path: "assetBasicInfo.type", value: "iphone" }
        ]
      }
    ) {
      total
      pagination {
        limit
        current
        next
        page
      }
      items
    }
  }
}
 
The returned result is,
{
    "data": {
        "site": {
            "assetResources": {
                "total": 6,
                "pagination": {
                    "limit": 50,
                    "current": "<cursor>",
                    "next": "<cursor>",
                    "page": "NEXT"
                },
                "items": []
            }
        }
    }
}
 
Can anyone help to explain why there are no items shown despite the total showing as 6? Could there be a permissions 
1 ACCEPTED SOLUTION

So I had to remove the cursor from "assetPagination" and also set page to be "FIRST". I also set the type to be "iOS" and on a 2nd query I used "iPad", which returned the expected results for me in the end. Thank you for your assistance!

View solution in original post

2 REPLIES 2
David_GF
Lansweeper Tech Support
Lansweeper Tech Support

hi @houseonthehill, the query is correct; it should give you the details. Have you tried with another assetBasicInfo.type value, or with fewer fields?



~~~~~~~ (〃 ̄︶ ̄)人( ̄︶ ̄〃) ~~~~~~~
Sweep that LAN, sweep it!

So I had to remove the cursor from "assetPagination" and also set page to be "FIRST". I also set the type to be "iOS" and on a 2nd query I used "iPad", which returned the expected results for me in the end. Thank you for your assistance!