Support » Plugin: Chatbot with IBM Watson » Using a client action

  • Resolved fychan66

    (@fychan66)


    I’m trying to make a custom call to an existing external API (not in IBM CloudFront) using the client type API call using the details at the link.

    Looking at the response, I can see the name & client calls come back in the response object from Watson API calls – but I can’t see how to build this out to do what I need.

    Does the “MyWeatherFunction” in the linked example need to be a JS function? A PHP function? A URL endpoint on the WordPress install? What should it accept/return/output?

    I can’t use CloudFront functions as my assistant is in Sydney, where the data functions can’t be hosted, hence the requirement for a client resolution.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support intelahelp

    (@intelahelp)

    Hello @fychan66. Thanks for asking your question.

    Dialog action can be either PHP or Javascript function depending on your implementation. Application (either PHP or Javascript) should:

    1. Detect the incoming action
    2. Extract parameters from action
    3. Process an action using parameters
    4. Return the action’s result to Watson Assistant in context variable named in action’s “result_variable” field

    Unfortunately, we don’t have simple and straightforward support for actions yet, but you may add them in either Javascript code that handles interactions with server or PHP code that handles interaction between your Worpdress server and Watson Assistant. You can see the code in our Github repository. If you will edit our Javascript code, it may be useful to check out React’s website and complete the initial tutorial to understand React’s core principles because our chatbox is implemented using React.

    If you have any more questions, don’t hesitate to ask them.

    Plugin Support intelahelp

    (@intelahelp)

    We haven’t heard from you recently.
    Do you still have any questions or need our assistance?
    We will gladly help you.

    Thanks – but I discovered that regardless as to if I could implement a solution in your plugin, the Watson Assistant didn’t support the JS API endpoints I required in the Sydney datacentre at the time. Using another datacentre wasn’t an option.

    As such, unfortunately I was limited by the endpoints more than your plugin. Cheers for follow up,

    Forgot to mark as resolved, apologies

    Plugin Support intelahelp

    (@intelahelp)

    Thank you @fychan66

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.