BULK Data API issue : unable to get output .
A week before I was aple to pull data from BUlk data api with basic ajax call
var connectionUri = 'Community URL?fromDate=20200427&toDate=20200428'
var dataToReturn = [];
var xhr = $.ajax({
url: connectionUri,
dataType: 'json',
headers : {
'client-id':client_id
},
beforeSend: function (xhr) {
xhr.setRequestHeader ("Authorization", "Basic " + btoa(username + ":" + password ));
xhr.setRequestHeader ("Accept","application/json");
//xhr.setRequestHeader ("Content-Disposition","attac");
},
success: function (json) {
Now I am getting error as
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at BULK DATA URL. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
Also when i tested this in post master i get this as output : SyntaxError: JSON.parse: unexpected keyword at line 1 column 1 of the JSON data
One observation though I was getting CSV output when i requested the bulk data api . Now the content seems to have changed.
Please let us know if anything has changed at source and do we need to handle code accordingly