regardless of knowledge about Kofax, please say anything wrong part of code you can find.
I’m beginner at javascript, so I really glad if I cat get some advice about this problem.
function callKofaxRoboRestApi() {
var endpointUrl = '**rest api url**';
var requestParams = {
'username': 'my user name',
'password': 'my password'
};
const accessToken = "**my token**";
var headers = {
'Authorization': 'Bearer ' + accessToken,
'Content-Type': 'application/json',
};
var options = {
'method': 'post',
'headers': headers,
'payload': JSON.stringify(requestParams)
};
var data = {
'entry': {
'group': {
'name': '**robot name**',
'type': 'robot'
}
}
};
var payload = JSON.stringify(data);
var response = UrlFetchApp.fetch(endpointUrl, options);
var responseData = JSON.parse(response.getContentText());
if (response.getResponseCode() == 200) {
Logger.log('success');
} else {
Logger.log('looser');
}
this code return with ‘Exeption: Address unavailable:rest api url/callkofaxRoboRestApi @kofax.documatation gs:38
Is there something wrong? or skipped code?