Watson Classifier curl authentication failing with userid and password

46 Views Asked by At

I followed the instructions and retrieved the credentials for https://gateway.watsonplatform.net/natural-language-classifier/api - from the resource list I was able to retrieve my Username and Password. I have a trained classifier that I can use with Watson Studio. The classifier I retrieved from the Watson Services page for my project is: befb8ax501-nlc-1441. I then try to test out a simple test - curl -u "{userid}":"{password}" "https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers/befb8ax501-nlc-1441" and I receive {"code":401, "error": "Unauthorized"} This seems very basic and simple, but I can't seem to get this to work. I am using curl because the python program I wrote (which worked a few months ago with a different password and service id) doesn't seem to be working. I can perform operations with the web interface so the service is working - but I can't seem to call it. Is there a way I can test my username and password? Am I using the correct format to make the call?

1

There are 1 best solutions below

0
On

Open your classifier and then click on your service. enter image description here

This will open service page, then go under service credentials, now if you see key like "apsx-data". Now thats the service credentials that the watson studio test screen uses. enter image description here

If you click apsx-data, it will expand, you can use the credential. If this credential, doesn't try to create new credential and try using that. If this still doesn't work, you should open a ticket since it may be specific to your service.