What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

API call fails with error 401

Votes:

0

Hi,

I'm trying to connect to PRTG to request some information via the API tools.

I'm requesting URL: https://myserver/api/table.json?content=sensors&columns=objid,group,device,sensor,status,message,lastvalue&username=myapiuser&passhash=myhash

When I run this URL, I'm getting an error message "Unauthorized".

I can't get out of this error. Can you please help me on this issue. Regards

access-denied http-api prtg

Created on May 27, 2020 6:58:06 AM



6 Replies

Votes:

0

Hi there,

The issue is that your authentication section of the API query is syntactically not valid.

&username=myapiuser&passhash=myhash

Authentication with username and passhash (or username and password) must always be included in each PRTG API request. See section Authentication for more information.

Best regards,
Sebastian

Created on May 27, 2020 5:56:41 PM by  Sebastian Kniege [Paessler Support]



Votes:

0

Hi, I'm sorry but I don't understand what is wrong in my query. I've tested the link https://yourserver/api/table.xml?content=sensors&columns=sensor&username=myuser&passhash=hash and I'm still getting error 401 Unauthorized

Regards Cyril

Created on May 28, 2020 8:14:49 AM



Votes:

0

Hello Cyril,

What PRTG version are you using?

Please let me know whether the following API call works for you:

http(s):your-prtg/api/table.xml?content=sensors&columns=sensor&username=prtgadmin&password=prtgadmin

Please adjust "http(s):/ /your-prtg" and "password=prtgadmin" to your actual configuration.

Best,
Sebastian

Created on May 28, 2020 9:08:38 AM by  Sebastian Kniege [Paessler Support]

Last change on May 28, 2020 9:09:02 AM by  Sebastian Kniege [Paessler Support]



Votes:

0

I'm running version 20.1.56.1547+

the url is working. XML file downloaded.

Cyril

Created on May 28, 2020 9:13:59 AM



Votes:

0

Ok, good then let's start from here. Start by updating your PRTG to the latest version. Then slowly adjust the API query. If you want to use the Passhash instead find the one that has to be used in PRTG under "Setup | Account Settings | My Account | Show Passhash" and change your API call "password=prtgadmin" to "passhash=hash".

Created on May 28, 2020 9:35:50 AM by  Sebastian Kniege [Paessler Support]

Last change on May 28, 2020 9:36:04 AM by  Sebastian Kniege [Paessler Support]



Votes:

0

So now, I'm up to date with PRTG, but it's still not working. Unauhorized. I've testes with params password and passhash -> ko If I test with a user issued for local AD it's working. Finally I've decided to create a new "test api" user and it's working... ?!?!? no difference between the two account

So now it's ok. test user is renamed to a more usefull name ! Thanks for support.

Created on Jun 2, 2020 4:36:58 PM




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.