Hello, I am trying to fetch a Survey Response via JS in SI but I am getting this error "Expected authorization in headers, but none provided". When I run the same code via JS in a surveyflow I am able to fetch the response without any issues. Any suggestions what could be wrong? I am running following code
(function() {
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://brandid.dc.qualtrics.com/API/v3/surveys/SV_12334521/responses/R_2323223232");
xhr.setRequestHeader("x-api-token", "xxxxxxx");
//xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
console.log(data);
})();
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.