2
votes

I'm trying to use IBM Watson Natural language Classifier but I can't proceed and load my answers. For some reason, username and password aren't working all the time.

This one executed fine:

 curl -u username:password -F [email protected] -F
 training_metadata="{\"language\":\"en\",\"name\":\"my_classifier\"}"
 "https://url/v1/classifiers"

But when I try to execute the following command, it doesn't work:

 curl -u username:password -X POST -H "Content-Type: application/json"
 -d @questions-with-classifier-ega-war/target/classes/answers.json http://yourAppName.mybluemix.net/api/v1/manage/answer

It just asks for the user and password again and again. It is the same password that just worked in the first curl command.

Thanks in advance!

1
Hi @Evandro this may be a temporary problem. Have you checked for any warnings? (click on your user icon on top right corner and then in "status")Leo
Hi @Leo , I checked status and my services are working correctly, both of them (Natural Language Classifier and SQL Database). The user and password I need to use on post it's my Natual Language Credentials, isn't it? I tried DB credentials, my own login.. any of them works. Here is the guide I'm following, if you wan't some reference (Stage 4): github.com/watson-developer-cloud/questions-with-classifier-egaEvandro Moraes
The credentials you have to use are in the VCAP_SERVICES variable. You can see it using the Bluemix UI.Leo
I'm not sure if it's only for this API or for other APIs too, but the user it's different from the one located at credentials. I had to use 'apiuser' and a password I set by my self.Evandro Moraes

1 Answers

0
votes

I think you are confusing the service credentials (the one you use in the first command) with the credentials used to manage the database in one of the sample applications "Questions on Classifier" (see pom.xml).

In order to run your second command make sure you use the credentials from the pom.xml in your root directory