2

I get an "Unexpected Error" from the following function:

function getBomgarFeedbackXML(){
  var url = "https://help.tradingtechnologies.com/api/reporting.ns?" + 
            "username=xxxxxx&password=xxxxxx&generate_report=SupportCustExitSurvey&" + 
            "start_date=2000-01-01&duration=0&report_type=rep&id=all";
  var response = UrlFetchApp.fetch(url).getContentText();
  Logger.log(response);
  return(Xml.parse(response, true));
}

The line that causes the error is:

var response = UrlFetchApp.fetch(url).getContentText();
  1. I am able to fetch the URL programatically using other scripting languages, such as python
  2. I have tried fetching the URL in my browser which I was able to do successfully
  3. I can fetch "http://www.google.com" from Google apps script successfully
  4. I get the following warning when navigating to the URL in chrome, could this be related to the issue ?

warning message

Any help is appreciated Thanks

1 Answer 1

2

The last bit with the untrusted certs is the big clue here. Seems like the SSL cert associated with 'help.tradingtechnologies.com'is not valid or signed by a trusted CA per the Google Data Centers (from where the UrlFetch calls originate).

To work around this try this line of code instead of your UrlFetch call. Note the additional option for validateHttpsCertificates documented here.

var response = UrlFetchApp.fetch(url, {'validateHttpsCertificates':false}).getContentText();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.