What I am doing is pretty straightforward. When I click a button, it fires runDataDownload() and adds a data download link on the web page. But what i got was job failure status with an error "message": "Authentication failed: Failed to login". What did I miss here? Please help.
<div>
<input type="button" onclick="runDataDownload()" value="Request data">
</div>
<scirpt>
window.onload = function() {
FMEServer.init({
server : "https://demos-safe-software.fmecloud.com",
token : "568c604bc1f235bbe137c514e7c61a8436043070"
});
};
function runDataDownload() {
var params = { "publishedParameters" : 7 { "name" : 'GEOM', "value" : 'POLYGON((-123.00399475097656 49.32606781005859,-122.9785888671875 49.22444427490234,-123.15643005371093 49.1509732055664,-123.00399475097656 49.32606781005859))' }, { "name" : 'THEMES', "value" : 7'BusRoutes'] }, { "name" : 'COORDSYS', "value" : 'BCALB-83' }, { "name" : 'GENERIC_FORMAT', "value" : 'ACAD' }]
};
FMEServer.runDataDownload('Demos', 'DataDownloadService.fmw', params.publishedParameters, showResults);
}
function showResults( json ) {
var resultText = result.serviceResponse.statusInfo.status;
var resultUrl = '';
var resultDiv = new Builder('<div />');
if(resultText == 'success'){
resultUrl = result.serviceResponse.url;
resultDiv.append(('<h2>Job ran sucessfully. Data can be downloaded <a href="' + resultUrl + '">' + 'here </a></h2>'));
}
else{
resultDiv.append(('<h2>There was an error processing your request. Here is the error message ' + result.serviceResponse.statusInfo.message + '</h2>'));
}
dom.byId('result').innerHTML = resultDiv;
}
</script>