Search code examples
watson-conversation

How to dynamically retrieve response types via Watson Assistant API


In Watson Assistant dialogs we are now able to specify various response types (text, options, image & pause)

E.g. enter image description here

Using the following API call I am only able to receive a "text" response, not an "options" response.

Any ideas?

curl -X POST \
  'https://gateway.watsonplatform.net/assistant/api/v1/workspaces/<Workspace ID>/message/?version=2018-02-16' \
  -H 'Authorization: Basic <Token>==' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
    "input": {
        "text": "Hi"
    }
}'

Solution

  • The reason why this did not work is that the feature is very new. We need to use the API version 2018-07-10

    curl -X POST \
      'https://gateway.watsonplatform.net/assistant/api/v1/workspaces/<Workspace ID>/message/?version=2018-07-10' \
      -H 'Authorization: Basic <Token>==' \
      -H 'Cache-Control: no-cache' \
      -H 'Content-Type: application/json' \
      -d '{
        "input": {
            "text": "Hi"
        }
    }'