06-10-2024 10:20 PM
We are integrating calls to the Lansweeper API for a client. When a user calls in to the helpdesk we would like to lookup their Lansweeper data and display some information for the helpdesk agent.
We have successfully set up our API access and are authenticating and getting an access token. We can test various GraphQL queries using Postman, but when we try to lookup account data for a use we are failing. We tried the example in the documentation at this link for getting authorized accounts, realizing we would have to filter it:
https://docs.lansweeper.com/docs/api/getting-data#get-asset-details
under heading "Listing authorized accounts", but we get 403 - Unauthorized. Our account has full admin rights.
Can you please advise the best way to do this?
Thanks,
George S.
Solved! Go to Solution.
07-08-2024 09:37 AM
Hi @gschally
You can pull the list of the email address for all the a authorized accounts using the code below, and then search the result with CTRL+F:
{
site(id: "XXXXXXXX-XXXX-XXXXX-XXXX") {
accounts
{
username
email
status
createdAt
joinedAt
lastTimeAccess
}
}
}
There does not seem to be a function to filter by email address.
07-05-2024 02:47 AM
Hi @@David_GF , thank you, that permission fixed it for us. Question, we are trying to retrieve the account data but filter it by email address, so we only get one account back. We are not having any luck, getting a syntax error returned. Here is what we are passing. Can you tell us what limitations there are on filtering fields?
07-08-2024 09:37 AM
Hi @gschally
You can pull the list of the email address for all the a authorized accounts using the code below, and then search the result with CTRL+F:
{
site(id: "XXXXXXXX-XXXX-XXXXX-XXXX") {
accounts
{
username
email
status
createdAt
joinedAt
lastTimeAccess
}
}
}
There does not seem to be a function to filter by email address.
06-26-2024 08:26 PM
Hi David, thank you for the reply. I am in the dashboard "Users" screen, and I don't see where permissions can be set. Can you advise?
06-27-2024 02:44 PM
Hi @gschally To manage the user permissions, you need to go to Configuration (the cog icon) > Account Management. You can adjust the Scopes and Roles and Permissions in that section. More information can be found in this knowledge base article: https://community.lansweeper.com/t5/cloud/configure-scopes-permissions-and-roles/ta-p/64512
06-12-2024 09:19 AM
Hi @gschally, when using the Lansweeper API to access account data, just make sure that the user making the request has the right permissions, especially the "View accounts" permission. If you see a 403 - Unauthorized error, it's likely because of not having enough permissions.
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now