-1

I'm trying out IBM Watson Assistant. Ultimate goal is to integrate it with my custom PHP backend, via it's Watson Assistant's cURL API Endpoints (because there's no complete PHP SDK yet).

When I setup a Dialog with the OPTIONS (other than, TEXT) as the Respond, the OPTIONS are perfectly working inside it's own "Try it out" Chat Window. But when I query it through the cURL API as usual, everything else is working except for that Dialogs with OPTIONS.

Here's the working example inside Try it out Window:

enter image description here

But then, here's the return from cURL API (for the same question asked):

stdClass Object
(
    [intents] => Array
        (
            [0] => stdClass Object
                (
                    [intent] => SOexchangenetworks
                    [confidence] => 1
                )

        )

    [entities] => Array
        (
        )

    [input] => stdClass Object
        (
            [text] => Which Stack Exchange Network should I go to look for an answer?
        )

    [output] => stdClass Object
        (
            [text] => Array
                (
                )

            [nodes_visited] => Array
                (
                    [0] => node_1_1531885028865
                )

            [log_messages] => Array
                (
                )

        )

    [context] => stdClass Object
        (
            [conversation_id] => 77ec8fc6-fb6a-4890-92b4-c58cdbc85ba3
            [system] => stdClass Object
                (
                    [dialog_stack] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [dialog_node] => root
                                )

                        )

                    [dialog_turn_counter] => 1
                    [dialog_request_counter] => 1
                    [branch_exited] => 1
                    [branch_exited_reason] => completed
                )

        )

)

Problem Highlight:

You can see that [output][text] section is totally blank, when the Dialog Respond contains OPTIONS.

Note: Normally, the [output][text] section contains the reply from Watson, if the Respond type is Text. I've been keep using this cURL API for a while.

How do I solve this please?

夏期劇場
  • 17,821
  • 44
  • 135
  • 217

1 Answers1

1

Based on the Watson Assistant release notes so called "rich responses" were added July 2018. The current API version is 2018-07-10. In your curl command you are using the API version 2018-02-16. Try the curl command again, but we the current API version.

data_henrik
  • 16,724
  • 2
  • 28
  • 49
  • Omg, thank you so much. That works! Should it then be safe NOT to define the version number please (aka) better ignore that parameter? – 夏期劇場 Jul 18 '18 at 07:17
  • 1
    The version is a required parameter for all API calls. The reason is that sometimes there are breaking changes, i.e., semantics might change. Thus, the version is required to define your expected result. Please mark as answered. – data_henrik Jul 18 '18 at 07:21