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

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

Votes:

0

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



Best Answer

Accepted Answer

Votes:

0

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

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

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



Votes:

0

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



Accepted Answer

Votes:

0

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]




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.