
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2025
07:50 PM
- last edited on
‎02-25-2025
08:29 PM
by
kh-laura
Hello, I've been slowly advancing in my testing using the lansweeper API. Now I have the following problem, I understand that it is possible to make a "pagination" of the results, my doubt is how I "advance" between one page and another. Can you help me.. Thank you
If that's my query, what should the next query look like to bring in the other items?
query getAssetResources {
site(id: "xxxxxxxxxxxxxxxxxxxxx") {
assetResources(
assetPagination: { limit: 2, page: FIRST }
fields: [
"assetBasicInfo.name"
"assetBasicInfo.userDomain"
"assetBasicInfo.description"
"operatingSystem.name"
]
) {
total
items
}
}
}
- Labels:
-
API & Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2025 03:44 PM
Thanks for the response, here I have my example of the query that does work and returns information, but I don't know what the next query should be like to bring the following results.
I think they complicated something that should be simpler. 🤔
query getAssetResources {
site(id: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx") {
assetResources(
fields: [
"assetBasicInfo.name"
"assetBasicInfo.userDomain"
"assetBasicInfo.description"
"assetBasicInfo.type"
]
filters: {
conjunction: AND
conditions: [
{ operator: EQUAL, path: "assetBasicInfo.type", value: "Windows" }
]
}
) {
total
pagination {
limit
current
next
page
}
items
}
}
}
The answer is...
{
"data": {
"site": {
"assetResources": {
"total": 690,
"pagination": {
"limit": 500,
"current": "MzU0MC1Bc3NldC03NTA2Zjc3NS0xMWIyLTQ3NGItOTVhOC00MzZjZTU0MmRhOGI=",
"next": "MzzzMS1Bc3NldC03NTA2Zjc3NS0xMWIyLTQ3NGItOTVhOC00MzZjZTU0MmRhOGI=",
"page": "FIRST"
},
"items": [
{
"assetBasicInfo": {
"userDomain": "xxxxxxx",
"name": "Ssssssssssssssssssss",
"type": "Windows",
"description": "Ssssssssssssssss"
},
"key": "MTU0MC1Bc3NldC03NTA2Zjc3NS0xMWIyLTQ3NGItOTVhOC00dddjZTU0MmRhOGI="
},
...................
...................
Could you explain to me what the next query should be like to bring the following data?
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2025 08:42 PM
Hi,
The next query you should use given the following response should be:
query getAssetResources {
site(id: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx") {
assetResources(
assetPagination: { cursor: "MzzzMS1Bc3NldC03NTA2Zjc3NS0xMWIyLTQ3NGItOTVhOC00MzZjZTU0MmRhOGI=" limit: 500, page: NEXT }
fields: [
"assetBasicInfo.name"
"assetBasicInfo.userDomain"
"assetBasicInfo.description"
"assetBasicInfo.type"
]
filters: {
conjunction: AND
conditions: [
{ operator: EQUAL, path: "assetBasicInfo.type", value: "Windows" }
]
}
) {
total
pagination {
limit
current
next
page
}
items
}
}
}
This will give you the next set of assets that were not returned with the initial results of the query.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2025 03:34 PM
Hello,
When you run a query that contains pagination, the pagination should be returned at the top of the query. The response will contain the limit of assets, your cursor's "current" position, and the cursor's "next" position. The current position refers to the beginning of the page, and the next to the end of the page of assets. The "next" cursor is important to page through your assets. Once you run an initial query and have the next cursor information you should construct your next pagination like so: assetPagination: { cursor: "xxxxxx-yyyyyy-zzzz-aaaaa99-bbbbbb" limit: 10, page: NEXT } by adding in the cursor string that is returned in the "next" field of your previous query. This will allow you to page through your assets until you reach the end and no assets are returned. It is important to always specify "NEXT" as if you type "FIRST" it will always give you the first page regardless of the cursor you select. For more information regarding pagination please view: Make your first requests | Documentation – Lansweeper. Finally, I would suggest increasing your limit of assets from 2 if you have a large number of assets as it will take a very long time to page through only 2 at a time.
Thanks!
