us2956
us2956

Reputation: 516

IBMWatson - How to run with cURL?

IBM Watson suggests some example on it's guide. But I can't work even a basic request.

curl -u "[email protected]":"password" "https://gateway.watsonplatform.net/language-translator/api/v2"

I can't understand why the request can't be authorized.

Error is here :

{ "code" : 401 , "error" : "Not Authorized" , "description" : "2017-11-24T17:52:58-05:00, Error ERCDPLTFRM-INVLDCHR occurred when accessing https://gateway.watsonplatform.net/language-translator/api/v2, Tran-Id: gateway-dp01-1410026512 - " }

Upvotes: 0

Views: 600

Answers (4)

Varun
Varun

Reputation: 76

Here you are using your account credentials, but cURL expects the service authorization credentials, to access these credentials Log into your IBM Cloud -> Dashboard -> Select Service (In your case language translator) -> Go to Credentials -> if you have one use the username and password from here else create credentials and use those credentials.

FYI they are not your email id and password

Upvotes: 0

Gianluca
Gianluca

Reputation: 51

I think I understood your problem! You are using your the Email and Password that you are using to log in to IBM Cloud. Usually Watson services would have their own credentials that protect your Watson Instance. To understand how to locate this credentials have a look here: https://console.bluemix.net/docs/services/watson/getting-started-credentials.html#getting-credentials-manually Basically this credentials will be written in the Credentials section in the overview page of the service. I hope it helps

Upvotes: 0

Mike Kistler
Mike Kistler

Reputation: 497

The username and password you specify to create a service instance are specific to the service you are using. They are not your IBM Cloud username and password.

See this link for more details: https://www.ibm.com/watson/developercloud/language-translator/api/v2/#authentication

Upvotes: 1

Alejandro Sanchez
Alejandro Sanchez

Reputation: 89

I think we need more details. But it looks like your credentials are wrong, you have to use the ones that are in your application instance in IBM-Cloud.

Upvotes: 0

Related Questions