What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Historicdata.json api call not working

Votes:

0

Your Vote:

Up

Down

Hello,

I am trying to use the API to get the historic data for my sensors. When using the webapp this is the URL

[server]/historicdata_html.htm?id=2244&sdate=2017-07-01-00-00-00&edate=2017-07-31-23-59-00&avg=86400&pctavg=300&pctshow=false&pct=95&pctmode=false

So for my API call I am using: [server]/api/historicdata.json?id=2244&sdate=2017-07-01-00-00-00&edate=2017-07-31-23-59-00&avg=86400

however from the API I am getting this response:

<prtg>
<version>17.2.31.2018</version>
<error>Sorry, the selected object cannot be used here.</error>
</prtg>

whereas the webapp is working perfectly.

Any suggestions would be greatly appreciated!

historic-data historicdata notifications prtg

Created on Aug 25, 2017 1:11:12 PM by  Stephen Watson (0) 1

Last change on Aug 28, 2017 11:08:38 AM by  Torsten Lindner [Paessler Support]



Best Answer

Accepted Answer

Votes:

0

Your Vote:

Up

Down

Stephen, I just tried the

/api/historicdata.json?id=objectid&avg=0&sdate=2017-01-20-00-00-00&edate=2017-01-21-00-00-00&usecaption=1

call on a .33 stable release and a .34 canary release, and on both it did work and produce a proper JSON file with historic data. Can you please run the update on your PRTG? It should then work just as well.

Created on Aug 31, 2017 5:24:06 AM by  Torsten Lindner [Paessler Support]



4 Replies

Votes:

0

Your Vote:

Up

Down

Hello,

Thank you for the KB-Post. Just to check, does it work when calling the historicdata.xml or historicdata.csv function instead?

best regards

Created on Aug 28, 2017 11:38:10 AM by  Torsten Lindner [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi,

Yes xml/csv do give me a response. however, both download a file and I need to consume the data in a web app so json is definitely preferable.

Thanks for your assistance

Created on Aug 30, 2017 9:32:35 AM by  Stephen Watson (0) 1



Accepted Answer

Votes:

0

Your Vote:

Up

Down

Stephen, I just tried the

/api/historicdata.json?id=objectid&avg=0&sdate=2017-01-20-00-00-00&edate=2017-01-21-00-00-00&usecaption=1

call on a .33 stable release and a .34 canary release, and on both it did work and produce a proper JSON file with historic data. Can you please run the update on your PRTG? It should then work just as well.

Created on Aug 31, 2017 5:24:06 AM by  Torsten Lindner [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Thanks Torsten, this worked perfectly. I should have tried that first.

Created on Aug 31, 2017 7:41:22 AM by  Stephen Watson (0) 1



Please log in or register to enter your reply.


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.