I have been stuck for two days in a very strange issue in Watson Assistant
I have made some code to be able to use it in my app, it keeps giving me 401 authentications error
these are the three services that I have configured in my IBM cloud account
and here is my code to initialize the three service
private fun initSpeechToTextService(): SpeechToText {
var options = IamOptions.Builder()
.apiKey(getString(R.string.speech_text_iam_apikey))
.url(getString(R.string.speech_text_url))
.build()
return SpeechToText(options)
}
private fun initTextToSpeechService(): TextToSpeech {
var options = IamOptions.Builder()
.apiKey(getString(R.string.text_speech_iam_apikey))
.url(getString(R.string.text_speech_url))
.build()
return TextToSpeech(options)
}
private fun initAssistantService(): Assistant {
var options = IamOptions.Builder()
.apiKey(getString(R.string.watson_assistant_iam_apikey))
.url(getString(R.string.watson_assistant_url))
.build()
var service = Assistant("2019-07-04", options)
service.endPoint = getString(R.string.watson_assistant_url)
return service
}
my problem now that I always get status: 401, error: Unauthorized
can anyone please tell me what is missing?
EDIT
here are the urls that I am using
- https://gateway-lon.watsonplatform.net/assistant/api
- https://gateway-lon.watsonplatform.net/speech-to-text/api
- https://gateway-lon.watsonplatform.net/text-to-speech/api
EDIT2
here is a screenshot of my debugger windows