1

I am trying to integrate Watson assistant with my website. When I try to get a token for authentication I get this error.

    "code" : 403 , "error" : "Forbidden" , "description" : "2018-09-11T13:37:57-05:00, Error ERCD-NOCONFIG occurred when accessing https://stream.watsonplatform.net/conversation/api, Tran-Id: stream01-1269192369 - " 

With the ERP system I am using I cannot use node.js or CURL, hence I am using an HTTP get request. I am sure my credentials are correct, is it the way they are formatted, or the incorrect url? I have tried multiple urls including "https://gateway.watsonplatform.net/authorization/api/v1/token", and "https://gateway.watsonplatform.net/assistant/api"

var utoken;
var header=[];
var user= {
 "xxxxxxxxxxxxxxx":"xxxxxxxx"         
}

// use JSON.stringify() in order to correctly format
user = JSON.stringify(user);
header['Content-Type']='application/json';
try{
  var response=https.get({
  url: "https://stream.watsonplatform.net/assistant/api",
  headers:header,
  user:user
});

//capture the utoken
 utoken = JSON.parse(response.body);
log.debug({
 title: 'utoken', 
 details: utoken
});
console.log(response);
}
catch(er01){
 log.debug({
   title: 'error', 
   details: 'token error'
 });   
bigburger554
  • 78
  • 2
  • 8
  • Are you on a newer instance of Watson Assistant with IAM-based authentication or on an older with username/password? Check here https://www.ibm.com/watson/developercloud/assistant/api/v1/curl.html?curl#authentication – data_henrik Sep 12 '18 at 06:59
  • I am using the username/password method. The ERP systems server acts as the proxy which is why I should be able to get away with not using CURL. This is the get token doc https://console.bluemix.net/docs/services/watson/getting-started-tokens.html#tokens-for-authentication – bigburger554 Sep 12 '18 at 14:27

0 Answers0