Title: Using a client action
Last modified: May 14, 2019

---

# Using a client action

 *  Resolved [fychan66](https://wordpress.org/support/users/fychan66/)
 * (@fychan66)
 * [7 years ago](https://wordpress.org/support/topic/using-a-client-action/)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fusing-a-client-action%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Intela-bot Help](https://wordpress.org/support/users/intelahelp/)
 * (@intelahelp)
 * [7 years ago](https://wordpress.org/support/topic/using-a-client-action/#post-11529883)
 * Hello [@fychan66](https://wordpress.org/support/users/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](https://github.com/HASidd/watson-assistant-wordpress).
   If you will edit our Javascript code, it may be useful to check out [React’s website](https://reactjs.org/)
   and complete the [initial tutorial](https://reactjs.org/tutorial/tutorial.html)
   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 Author [Intela-bot Help](https://wordpress.org/support/users/intelahelp/)
 * (@intelahelp)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/using-a-client-action/#post-11731878)
 * We haven’t heard from you recently.
    Do you still have any questions or need 
   our assistance? We will gladly help you.
 *  Thread Starter [fychan66](https://wordpress.org/support/users/fychan66/)
 * (@fychan66)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/using-a-client-action/#post-11731940)
 * 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,
 *  Thread Starter [fychan66](https://wordpress.org/support/users/fychan66/)
 * (@fychan66)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/using-a-client-action/#post-11731944)
 * Forgot to mark as resolved, apologies
 *  Plugin Author [Intela-bot Help](https://wordpress.org/support/users/intelahelp/)
 * (@intelahelp)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/using-a-client-action/#post-11731986)
 * Thank you [@fychan66](https://wordpress.org/support/users/fychan66/)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Using a client action’ is closed to new replies.

 * ![](https://ps.w.org/conversation-watson/assets/icon-256x256.png?rev=1684465)
 * [Chatbot with IBM watsonx Assistant](https://wordpress.org/plugins/conversation-watson/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/conversation-watson/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/conversation-watson/)
 * [Active Topics](https://wordpress.org/support/plugin/conversation-watson/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/conversation-watson/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/conversation-watson/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [call](https://wordpress.org/support/topic-tag/call/)
 * [client](https://wordpress.org/support/topic-tag/client/)
 * [json](https://wordpress.org/support/topic-tag/json/)

 * 5 replies
 * 2 participants
 * Last reply from: [Intela-bot Help](https://wordpress.org/support/users/intelahelp/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/using-a-client-action/#post-11731986)
 * Status: resolved