0
votes

I am getting the following error when I try to open a websocket.

Invalid access to resource - /speech-to-text/api/v1/recognize?model=en-US_BroadbandModel&watson-token=

User access not Authorized.

Gateway Error Code : ERCD04-NOAUTHHDR-PLTFRMREQ

Unable to communicate with Watson.

Request URL : /speech-to-text/api/v1/recognize?model=en-US_BroadbandModel&watson-token=

Error Id : stream-dp01-47767984

Date-Time : 2016-03-26T16:05:04-04:00

I have no idea what this error means. I am using this client code in Golang to open the websocket.

// Simplified code to get token
baseURL, _ := url.Parse("https://stream.watsonplatform.net/authorization/api/v1/token")
params := url.Values{}
params.Add("url", "https://stream.watsonplatform.net/speech-to-text/api")
baseURL.RawQuery = params.Encode()

req, _ := http.NewRequest(http.MethodGet, baseURL.String(), nil)
req.SetBasicAuth(IBMUsername, IBMPassword)
resp, _ := http.DefaultClient.Do(req)
token, _ := ioutil.ReadAll(resp.Body)

// Simplified code to open websocket
baseURL, _ := url.Parse("wss://stream.watsonplatform.net/speech-to-text/api/v1/recognize")
params := url.Values{}
params.Add("watson-token", token)
params.Add("model", "en-US_BroadbandModel")
baseURL.RawQuery = params.Encode()

ws, _ := websocket.Dial(baseURL.String(), "", "http://localhost:8000")
1
Hello, are you passing the authentication credentials in the REST call to get the auth token? You need to use Basic Auth to get a token. please let me knowDaniel Bolanos
@DanielBolanos I am. You can see the part of my code above where I use basic auth.Ben Sandler

1 Answers

1
votes

The service is experiencing some issues right now; the team is aware and working on it. Sorry for the trouble, please try again in a little while.