Skip to content

Commit

Permalink
Merge pull request #1907 from clordan/source
Browse files Browse the repository at this point in the history
  • Loading branch information
cfsdocs committed Sep 27, 2023
1 parent 80a2e57 commit 42fb1cf
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 50 deletions.
24 changes: 7 additions & 17 deletions dialog-webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,19 @@ subcollection: assistant

---

{:shortdesc: .shortdesc}
{:new_window: target="_blank"}
{:external: target="_blank" .external}
{:deprecated: .deprecated}
{:important: .important}
{:note: .note}
{:tip: .tip}
{:pre: .pre}
{:codeblock: .codeblock}
{:screen: .screen}
{:javascript: .ph data-hd-programlang='javascript'}
{:java: .ph data-hd-programlang='java'}
{:python: .ph data-hd-programlang='python'}
{:swift: .ph data-hd-programlang='swift'}
{:video: .video}

{{site.data.content.newlink}}
{{site.data.keyword.attribute-definition-list}}

Documentation for the **classic {{site.data.keyword.assistant_classic_short}}** experience has moved. For the most up-to-date version, see [Making a programmatic call from dialog](/docs/watson-assistant?topic=watson-assistant-dialog-webhooks){: external}. To see all documentation for the new {{site.data.keyword.conversationshort}}, please go [here](https://cloud.ibm.com/docs/watson-assistant){: external}.
{: attention}

# Making a programmatic call from dialog
{: #dialog-webhooks}

To make a programmatic call, define a webhook that sends a POST request callout to an external application that performs a programmatic function. You can then invoke the webhook from one or more dialog nodes.

If you are using actions instead of dialog, you can use a custom extension to make programmatic calls. For more information, see [Calling a custom extension](/docs/watson-assistant?topic=watson-assistant-call-extension).
{: note}

A webhook is a mechanism that allows you to call out to an external program based on something happening in your program. When used in a dialog skill, a webhook is triggered when the assistant processes a node that has a webhook enabled. The webhook collects data that you specify or that you collect from the user during the conversation and save in context variables. It sends the data as part of a HTTP POST request to the URL that you specify as part of your webhook definition. The URL that receives the webhook is the listener. It performs a predefined action using the information that you pass to it as specified in the webhook definition, and can optionally return a response.

You can use a webhook to do the following types of things:
Expand Down
4 changes: 3 additions & 1 deletion release-notes-chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ subcollection: assistant
# Web chat release notes
{: #release-notes-chat}

Release notes for the **classic {{site.data.keyword.assistant_classic_short}}** experience have moved. All release notes for Web chat for {{site.data.keyword.assistant_classic_short}} can be found here: [Web chat release notes](/docs/watson-assistant?topic=watson-assistant-release-notes-chat){: external}.
## Release notes for the **classic {{site.data.keyword.assistant_classic_short}}** experience have moved

As of 22 June 2023, these release notes are no longer being updated. All release notes for both the new {{site.data.keyword.conversationshort}} and the classic {{site.data.keyword.assistant_classic_short}} can be found here: [Web chat release notes](/docs/watson-assistant?topic=watson-assistant-release-notes-chat){: external}.
{: attention}

## 7.4.0
Expand Down
5 changes: 4 additions & 1 deletion webhook-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

copyright:
years: 2019, 2023
lastupdated: "2023-09-01"
lastupdated: "2023-03-24"

keywords: log webhook

Expand All @@ -12,6 +12,9 @@ subcollection: assistant

{{site.data.keyword.attribute-definition-list}}

Documentation for the **classic {{site.data.keyword.assistant_classic_short}}** experience has moved. For the most up-to-date version, see [Logging activity with a webhook](/docs/watson-assistant?topic=watson-assistant-webhook-log){: external}. To see all documentation for the new {{site.data.keyword.conversationshort}}, please go [here](https://cloud.ibm.com/docs/watson-assistant){: external}.
{: attention}

# Logging activity with a webhook
{: #webhook-log}

Expand Down
49 changes: 18 additions & 31 deletions webhook-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,10 @@ subcollection: assistant

---

{:shortdesc: .shortdesc}
{:new_window: target="_blank"}
{:external: target="_blank" .external}
{:deprecated: .deprecated}
{:important: .important}
{:note: .note}
{:tip: .tip}
{:pre: .pre}
{:codeblock: .codeblock}
{:screen: .screen}
{:javascript: .ph data-hd-programlang='javascript'}
{:java: .ph data-hd-programlang='java'}
{:python: .ph data-hd-programlang='python'}
{:swift: .ph data-hd-programlang='swift'}
{:video: .video}

{{site.data.content.newlink}}
{{site.data.keyword.attribute-definition-list}}

Documentation for the **classic {{site.data.keyword.assistant_classic_short}}** experience has moved. For the most up-to-date version, see [Extending your assistant with webhooks](/docs/watson-assistant?topic=watson-assistant-webhook-overview){: external}. To see all documentation for the new {{site.data.keyword.conversationshort}}, please go [here](https://cloud.ibm.com/docs/watson-assistant){: external}.
{: attention}

# Webhook overview
{: #webhook-overview}
Expand All @@ -36,17 +23,17 @@ Make a call to an external service or application during a conversation.

- Skill-level webhooks

The following type of webhook can be set up for use from a dialog skill:
The following type of webhook can be set up for use from a dialog skill:

- [Dialog](/docs/assistant?topic=assistant-dialog-webhooks)
- [Dialog](/docs/assistant?topic=assistant-dialog-webhooks)

- Assistant-level webhooks

The following types of webhooks can be set up for an assistant:
The following types of webhooks can be set up for an assistant:

- [Logs](/docs/assistant?topic=assistant-webhook-log)
- [Premessage](/docs/assistant?topic=assistant-webhook-pre)
- [Postmessage](/docs/assistant?topic=assistant-webhook-post)
- [Logs](/docs/assistant?topic=assistant-webhook-log)
- [Premessage](/docs/assistant?topic=assistant-webhook-pre)
- [Postmessage](/docs/assistant?topic=assistant-webhook-post)

## Which type of webhook should I use?
{: #webhook-overview-difs}
Expand All @@ -55,23 +42,23 @@ The skill-level webhook is different from the assistant-level webhooks in the fo

- Frequency with which the webhooks is called

The dialog webhook is called on the rare occasion that the dialog node from which it is triggered is processed.
The dialog webhook is called on the rare occasion that the dialog node from which it is triggered is processed.

The message processing webhooks are called with every single exchange in a conversation between the customer and the assistant.
The message processing webhooks are called with every single exchange in a conversation between the customer and the assistant.

The log webhook is called with each message and its corresponding response.
The log webhook is called with each message and its corresponding response.

- Where the condition is defined

For a dialog webhook, the condition to meet before an action is taken is defined in the dialog skill. If the node condition is not met, then the dialog webhook is never called.
For a dialog webhook, the condition to meet before an action is taken is defined in the dialog skill. If the node condition is not met, then the dialog webhook is never called.

For the message processing webhooks, the condition to check for before taking an action must be defined in the external application code. For example, even if your webhook performs a simple language translation, you'd want to use a condition to check the language of the incoming message before sending the text to the translation service.
For the message processing webhooks, the condition to check for before taking an action must be defined in the external application code. For example, even if your webhook performs a simple language translation, you'd want to use a condition to check the language of the incoming message before sending the text to the translation service.

You don't need to define a condition for the log webhook unless you want to filter the messages somehow. In most cases, the goal is to write out every message that is submitted, so the messages can be stored for as long as you want, and analyzed by an external application or service.
You don't need to define a condition for the log webhook unless you want to filter the messages somehow. In most cases, the goal is to write out every message that is submitted, so the messages can be stored for as long as you want, and analyzed by an external application or service.

- Where you configure them

You configure the dialog webhook from the the **Options>Webhook** page of the dialog skill. You then initialize it from one or more dialog nodes by customizing the node.
You configure the dialog webhook from the the **Options>Webhook** page of the dialog skill. You then initialize it from one or more dialog nodes by customizing the node.

You configure the assistant-level webhooks from the **Settings>Webhooks** page for the assistant.
You configure the assistant-level webhooks from the **Settings>Webhooks** page for the assistant.

3 changes: 3 additions & 0 deletions webhook-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ subcollection: assistant

{{site.data.keyword.attribute-definition-list}}

Documentation for the **classic {{site.data.keyword.assistant_classic_short}}** experience has moved. For the most up-to-date version, see [Making a call after processing a message](/docs/watson-assistant?topic=watson-assistant-webhook-post){: external}. To see all documentation for the new {{site.data.keyword.conversationshort}}, please go [here](https://cloud.ibm.com/docs/watson-assistant){: external}.
{: attention}

# Making a call after processing a message
{: #webhook-post}

Expand Down
3 changes: 3 additions & 0 deletions webhook-pre.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ subcollection: assistant

{{site.data.keyword.attribute-definition-list}}

Documentation for the **classic {{site.data.keyword.assistant_classic_short}}** experience has moved. For the most up-to-date version, see [Making a call before processing a message](/docs/watson-assistant?topic=watson-assistant-webhook-pre){: external}. To see all documentation for the new {{site.data.keyword.conversationshort}}, please go [here](https://cloud.ibm.com/docs/watson-assistant){: external}.
{: attention}

# Making a call before processing a message
{: #webhook-pre}

Expand Down

0 comments on commit 42fb1cf

Please sign in to comment.