You need to sign in to do that
Don't have an account?
Ujwala
Rest call to tool installed on localhost
Hi all,
I am working on integration PRTG with salesforce. PRTG is locally installed (at http://127.0.0.1 ).
I used following endpoint
public String baseUrl = 'http://127.0.0.1/api/table.xml?content=sensors&columns=sensor&username=prtgadmin&passhash=xxxx'; /
public String username = 'prtgadmin';
public String password = 'Pune@123';
public void PRTGIntegration1(){
HttpRequest req = new HttpRequest();
Http http = new Http();
// req.setHeader('Accept', 'application/xml');
// req.setHeader('Content-Type','application/xml');
Blob headerValue = Blob.valueOf(username+':'+password);
// req.setHeader('Authorization','Basic '+ EncodingUtil.base64Encode(headerValue));
req.setMethod('GET');
req.setEndpoint(baseUrl);
try{
//Execute web service call here
HTTPResponse res = http.send(req);
String ResponseJsonString = res.getStatus();
}
But i am getting status code as 403 forbidden after execution.
is there any problem with url i am mentioning because prtg is on LAN. So when i call endpoint from cloud do i have to mention ip address or something else i should take care of
Please help!!
I am working on integration PRTG with salesforce. PRTG is locally installed (at http://127.0.0.1 ).
I used following endpoint
public String baseUrl = 'http://127.0.0.1/api/table.xml?content=sensors&columns=sensor&username=prtgadmin&passhash=xxxx'; /
public String username = 'prtgadmin';
public String password = 'Pune@123';
public void PRTGIntegration1(){
HttpRequest req = new HttpRequest();
Http http = new Http();
// req.setHeader('Accept', 'application/xml');
// req.setHeader('Content-Type','application/xml');
Blob headerValue = Blob.valueOf(username+':'+password);
// req.setHeader('Authorization','Basic '+ EncodingUtil.base64Encode(headerValue));
req.setMethod('GET');
req.setEndpoint(baseUrl);
try{
//Execute web service call here
HTTPResponse res = http.send(req);
String ResponseJsonString = res.getStatus();
}
But i am getting status code as 403 forbidden after execution.
is there any problem with url i am mentioning because prtg is on LAN. So when i call endpoint from cloud do i have to mention ip address or something else i should take care of
Please help!!