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

Hi !

I'm trying to use the "editAsset" function using Lansweeper API.

With Postman I make a POST on https://api.lansweeper.com/api/v2/graphql/ , providing my token on the Header.

I copied pasted the EXAMPLE REQUEST on this page https://api.lansweeper.com/api/v2/graphql/  as GraphSQL Query and gives as variables my site id and an asset kay.

 
I already have the following answer from the API : 
 
{
    "errors": [
        {
            "message": "Asset with key 'yyy' not found in site 'xxx"
        }
    ],
    "data": {
        "site": {
            "editAsset": null
        }
    }
}
 
As value for key I use the "Unique Key" field accesible when editing asset or by searching for AssetUnique on the SQL Database. I also tried with the AssetID on the SQL DB.
It always remain to the same error message, even though assets with this references really exists ... 
 
What could cause this issue ?
 
Thanks a lot !
1 ACCEPTED SOLUTION
David_GF
Lansweeper Tech Support
Lansweeper Tech Support

hi @mmazoyer 

The asset key can be obtained with the asset.assetKey field, you can use the query in https://docs.lansweeper.com/docs/api/getting-data#get-asset-details to get the asset details, including the key.

 



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

View solution in original post

2 REPLIES 2
mmazoyer
Engaged Sweeper

hi @David_GF 

Thanks for this answer.

It seems that the asset.assetKey field does not exist on the API...

But, I finally resoled the problem using the resourceGroup.assetKey field. 

Thanks !

David_GF
Lansweeper Tech Support
Lansweeper Tech Support

hi @mmazoyer 

The asset key can be obtained with the asset.assetKey field, you can use the query in https://docs.lansweeper.com/docs/api/getting-data#get-asset-details to get the asset details, including the key.

 



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