Habiba007
Habiba007

Reputation: 53

Request Body of IBM Watson Assistant for webhook

I'm creating a bot using IBM Watson Assistant. I am trying to use a webhook, but don't know the format of the POST request JSON/HTML which is sent to the webhook.

My case study is a shop where user can pre-order. I want to send the order details to my back-end server and give the user a reference number for the pre-order. I found nothing in the documentation about what POST request format is sent from IBM Watson Assistant and in what format response should be returned.

I know IBM Watson Assistant does not require a particular response format. It allows the developer to manipulate the response as the developer wants.

Upvotes: 0

Views: 1188

Answers (1)

data_henrik
data_henrik

Reputation: 17176

IBM Watson Assistant has a documented API. There are the recommended V2 Assistant API which can be used to create session and then send messages. The older V1 Assistant API has more functions and is deeper into the system. Both APIs can be used to write chatbots.

If you mean a Webhook as the Watson Assistant feature to reach out from a dialog node to an external service, the process is the following:

  • in the global configuration, you define the URL and the header
  • for a dialog node, you enable webhooks, then define the key / value pairs that are sent as payload. They can differ by dialog node.
  • Typically, the expected result is JSON data because it is the easiest to process.

This IBM Cloud Solution tutorial on building a Slack bot with Watson Assistant uses webhooks to call out to a Db2 database. The code is available in a GitHub repo.

Upvotes: 1

Related Questions