• Resolved abbydigital

    (@abbydigital)


    I have built a chatbot using IBM Watson, to collect assessment data from a patient. I want to use WP Webhooks to put the collected data into a new WordPress post. Does this seem like a good use of WP Webhooks, and if so, can you provide an example of the code needed for this process and where the code goes?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Ironikus

    (@ironikus)

    Hi @abbydigital – thanks for your request.
    If you have an example for me of how the request you are going to send looks like, I’ll create a sample for you.
    What you basically need to do to make it work with our plugin:

    You need to send a POST request to the webhook URL that is created with our plugin.
    For that, you can send a One-dimensional JSON construct, XML or a www-form.
    You can read more about that here: https://ironikus.com/docs/knowledge-base/how-to-send-your-data-format/

    If you have further questions, feel free to let me know.

    Thread Starter abbydigital

    (@abbydigital)

    My chatbot asks a series of questions, mostly yes/no, with a few that have 3 possible answers. At the end of the questions, I want the chatbot to create a new post on the WordPress site and populate a series of custom fields with the answers that were received in the chat. For example, here are the responses from a completed chat:

    $name
    “Eddie”
    $orthopnea
    “yes”
    $false
    “no”
    $q1b_rest_sob
    “no”
    $q1c_talk_sob
    “mild”
    $q1d_walk_sob
    “no”
    $q2_pillows
    “yes”
    $q3_leg_swelling
    “yes”
    $q3B_leg_count
    “both”
    $q3c_leg_warm
    “yes”

    I think the post title should be a concatenation of the users name and the current date.

    Plugin Contributor Ironikus

    (@ironikus)

    Thanks for your answer @abbydigital

    Do you have a possibility to send a POST request using the chatbot?

    One thing that’s important: With the free version of WP Webhooks, we don’t have a direct integration for meta values of posts.
    Still, if you don’t feel using the pro version, it will still be possible using a custom function at the end of the post creation. Therefore, you can define another parameter called “do_action” within the request and call it then after the request fires.
    If you want to go with that way, I will share more information on that. ??
    In case you are keen about the differences of both versions, here’s a comparison: https://ironikus.com/compare-wp-webhooks-pro/

    If you have further questions, please let me know.

    Thread Starter abbydigital

    (@abbydigital)

    Thanks for the speedy replies, Ironikus!

    Yes, the Watson ChatBot DOES have the ability to send a POST request.

    Regarding the Pro version of WP Webhooks: If we can get this to work, and if the Pro version is necessary to do so, that would be fine.

    Plugin Contributor Ironikus

    (@ironikus)

    You are welcome @abbydigital!

    In that case, you should be able to send the request through.

    For the Pro version: It’s not directly necessary, but it makes things a lot easier due to predefined solutions.
    If you have further questions, feel free to let me know.

    Thread Starter abbydigital

    (@abbydigital)

    While I appreciate your fast responses, I still have no further clue as to what I need to do.

    On my WordPress site, I have both the IBM Watson CHatBot, which is fully programmed and operational.
    I also have the WP Webhooks plugin installed with an appropriately named Webhook set up.
    In the Chatbot setup, I am calling the URL for the Webhook set up in WP Webhooks.
    I have an additional callout, which is postID and some random number I put in.
    I have not yet added any of the context variables, because I was hoping to see a new post created in the WordPress site, but that is not happening.

    Which all basically brings me right back to when I sent the original post to this forum, looking for answers.

    Still feeling lost in the wilderness here…

    Plugin Contributor Ironikus

    (@ironikus)

    Don’t worry @abbydigital – we’ll get that settled!
    If you reach out to us through our website, I will take your case and we can share some screenshots via mail to make communication easier.
    Once we solved it, I will update this thread with the final solution.
    You can reach out to us here: https://ironikus.com/contact/

    Plugin Contributor Ironikus

    (@ironikus)

    Hello @abbydigital – based on our conversation yesterday, I’m going to update this thread based on the solution we found.
    Using the default webhook functionality for the IBM Watson chatbot, you can send POST requests to our WP Webhooks plugin. Within their interface, you can simply define the action and all the other functionality the plugin offers.
    That said, I’m going to close this thread.
    If you have further questions, feel free to answer here or create a new one.
    Thanks for reaching out!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘receiving data from IBM Watson chatbot’ is closed to new replies.