I have an access token, which I'm using in a POST request to the "https://api.lansweeper.com/api/v2/graphql" endpoint.
My request looks like the following,
Headers
"Content-type" : "application/json",
"Authorization" : "Bearer TOKEN_RETRIEVED_USING_AUTH_CODE_BEFORE",
Body (raw JSON)
{"query":"query getAssetResources {\r\n site(id: \"my site id\") {\r\n assetResources(\r\n assetPagination: { page: FIRST }\r\n filters: {\r\n conditions: [\r\n {\r\n operator: EQUAL\r\n path: \"assetBasicInfo.type\"\r\n value: \"Windows\"\r\n }\r\n ]\r\n }\r\n fields: [\r\n \"assetBasicInfo.name\"\r\n \"assetBasicInfo.domain\"\r\n \"assetBasicInfo.userName\"\r\n \"assetCustom.contact\"\r\n \"assetCustom.department\"\r\n \"assetCustom.deviceVersion\"\r\n \"assetBasicInfo.type\"\r\n \"assetCustom.model\"\r\n \"assetCustom.purchaseDate\"\r\n \"assetCustom.manufacturer\"\r\n \"assetCustom.softwareVersion\"\r\n \"operatingSystem.caption\"\r\n \"assetBasicInfo.lastSeen\"\r\n \"assetCustom.stateName\"\r\n \"assetCustom.warrantyDate\"\r\n \"assetCustom.serialNumber\"\r\n ]\r\n ) {\r\n total\r\n pagination {\r\n limit\r\n current\r\n next\r\n page\r\n }\r\n items\r\n }\r\n }\r\n}","variables":{}}
This is the result I receive,
{"errors":[{"message":"You don't have access to this site"}],"data":{"site":null}}
Not sure where I'm going wrong with this as the access token has been retrieved successfully via an authorization code where I was logged into the LanSweeper Cloud client with my only login account, which is an administrator account that has access to everything. Any ideas what I could be doing wrong here?