New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

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

Free PRTG
Download >>

 

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

 

Top Tags


View all Tags


How to configure allow-access-control-origin in PRTG API response headers?

Votes:

0

Your Vote:

Up

Down

Hi, I'm trying to query the PRTG API for historic data to put on an internal dashboard style website. However, whenever I try to access the historic data via xml, my Chrome tells me:

Origin http://mywebsite is not allowed by Access-Control-Allow-Origin.

As it would, because the Access-Control-Allow-Origin header is not being received from the PRTG api.

How can I configure the PRTG api to return a Access-Control-Allow-Origin which includes my website address?

Thanks,

Sam

api header prtg

Created on Mar 6, 2013 10:12:33 AM by  Sam Martin (0) 1



Best Answer

Accepted Answer

Votes:

0

Your Vote:

Up

Down

Please see this article for how to set the value for the Access-Control-Allow-Origin HTTP response header with a registry key option. You can use this feature as of PRTG version 15.x.20.

Created on Sep 15, 2015 4:09:57 PM by  Gerald Schoch [Paessler Support]



4 Replies

Votes:

0

Your Vote:

Up

Down

Hello,

I'm very sorry, but currently it's not possible to set this header for API Calls.

best regards.

Created on Mar 6, 2013 5:04:26 PM by  Torsten Lindner [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Is there any way to workaround this? E.g. wrap the XML in json so I can execute a JSONP request and then parse the XML within?

Thanks,

Sam

Created on Mar 7, 2013 1:17:49 PM by  Sam Martin (0) 1



Votes:

0

Your Vote:

Up

Down

You can do this: $.ajax({ type: "GET", url: url, dataType:'jsonp', cache: false, crossDomain: 'true', success: function(result){ do something } });

but then you get problems with the server header returning the wrong mime-type (text/html), witch i haven't been able to bypass. Should the mime-type returned be application/json ?

Created on Jul 5, 2013 12:39:45 PM by  Eirik (0) 1



Accepted Answer

Votes:

0

Your Vote:

Up

Down

Please see this article for how to set the value for the Access-Control-Allow-Origin HTTP response header with a registry key option. You can use this feature as of PRTG version 15.x.20.

Created on Sep 15, 2015 4:09:57 PM by  Gerald Schoch [Paessler Support]



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.