Search code examples
androidibm-cloudibm-watsonwatson-assistant

How can I fix No Agent definition found for id Watson Assistant error?


The problem is about creating an app that uses Watson chatbot.

Well, I used Vidyasagar Machupalli code the app worked but the part of chatbot didn't. Here is the logcat error:

(2019-04-28 07:36:02.927 4315-4372/com.example.vmac.chatbot D/OkHttp: <-- 404 Not Found https://gateway-lon.watsonplatform.net/assistant/api/v2/assistants/81d0c0e2-5c74-45c6-9f3b-63bcf1b0b281/sessions?version=2018-11-08 (662ms, 105-byte body)
2019-04-28 07:36:02.966 4315-4372/com.example.vmac.chatbot E/WatsonService: POST https://gateway-lon.watsonplatform.net/assistant/api/v2/assistants/81d0c0e2-5c74-45c6-9f3b-63bcf1b0b281/sessions?version=2018-11-08, status: 404, error: NotFound: No Agent definition found for id: 81d0c0e2-5c74-45c6-9f3b-63bcf1b0b281
2019-04-28 07:36:02.974 4315-4372/com.example.vmac.chatbot W/System.err: com.ibm.watson.developer_cloud.service.exception.NotFoundException: NotFound: No Agent definition found for id: 81d0c0e2-5c74-45c6-9f3b-63bcf1b0b281)

<?xml version="1.0" encoding="utf-8"?>
<resources>

<!--Watson Assistant service credentials-->
<!-- REPLACE `ASSISTANT_ID_HERE` with ID of the Assistant to use -->
<string name="assistant_id">####################################</string>


<!-- REPLACE `ASSISTANT_API_KEY_HERE` with Watson Assistant service API Key-->
<string name="assistant_apikey">##################################</string>

<!-- REPLACE `ASSISTANT_URL_HERE` with Watson Assistant service URL-->
<string name="assistant_url">https://gateway-lon.watsonplatform.net/assistant/api</string>


<!--Watson Speech To Text(STT) service credentials-->
<!-- REPLACE `STT_API_KEY_HERE` with Watson Speech to Text service API Key-->
<string name="STT_apikey">#############################</string>

<!-- REPLACE `STT_URL_HERE` with Watson Speech to Text service URL-->
<string name="STT_url">https://gateway-lon.watsonplatform.net/speech-to-text/api</string>


<!--Watson Text To Speech(TTS) service credentials-->
<!-- REPLACE `TTS_API_KEY_HERE` with Watson Text to Speech service API Key-->
<string name="TTS_apikey">############################</string>

<!-- REPLACE `TTS_URL_HERE` with Watson Text to Speech service URL-->
<string name="TTS_url">https://gateway-lon.watsonplatform.net/text-to-speech/api</string>d


Solution

  • The reason you are seeing the error is instead of Assistant ID you are passing Skill ID in your config.xml. Create an Assistant using the Skill you created and pass the Assistant ID in the config.xml

    Here's how you can link your Skill to an Assistant

    Also. never share your credentials in public forums.

    Updated: Here's where you can find your Assistant ID by clicking Settings as shown in the image below and then API Details enter image description here