Neatnik

Neatnik’s Watson Assistant Webhook

This is a free experimental open webhook for use with IBM’s Watson Assistant service.

The idea behind this service is to promote the use of webhooks in Watson Assistant and to make it easy to extend your Watson-powered chatbot with some fun new features.

Currently, the webhook offers the endpoints shown as "Live" below, but soon you’ll be able to register to extend an instance of the webhook with your own additional custom third-party webhook calls. Watch this space for updates.

You can test the webhook through this preview Assistant, or download the sample skill.

Endpoints

Service Description & Configuration Availability
Jokes

Returns a random corny joke. (Some cornier than others.)

Free; no third-party integration used.

Key Value Notes
joke true Required.
Live
Coin Flip

Returns a "heads" or "tales" response based on the outcome of a coin flip.

Free; no third-party integration used.

Key Value Notes
coin_flip true Required.
Live
Memory

Store and recall small pieces of information.

Free; no third-party integration used.

Store information

Key Value Notes
storage_key Any short string Required. Should consist of a unique identifier to associate with your information. If you’re storing information about a person, this could be the person’s email address. The same key is needed to recall the information later.
store_[key] Any short string Required. The value in [key] should be another unique string identifying the information in question. Example: store_color

Because of the arbitrary storage keys used, e.g. store_name, store_birthday, etc., you can store multiple pieces of information in a single webhook operation.

Recall information

Key Value Notes
recall_key Same value as the storage_key previously used Required.
recall The key to recall Required.

The response will consist of the value that was previously stored for the combination of recall_key and recall value provided.

Beta
News

Returns current top news headlines.

Uses the News API top headlines data source. API key required.

Key Value Notes
news true Required.
key A News API key Required.
sources An id value from one of these sources Optional. Example: ars-technica or multiple sources separated by comma: associated-press,bbc-news,cbc-news
country A two letter ISO 3166-1 country code Optional. Example: us
q Any text query, used for searching news stories Optional.
count A number from 1 to 20 Optional. Defaults to 3.

Note that while sources, country, and q are optional, at least one is required for the call to be successful. Also, News API doesn’t support mixing both country and sources, so if both are provided then sources will take priority.

The response will include attribution to News API, as required by their terms.

Beta
Weather Returns weather information for the specified locale. Pending
Stocks Returns stock quotes for the specified ticker symbol. Pending
Traffic Returns road construction and traffic incident data for the specified locale. Pending

Using the webhook

It’s super easy to get started with webhooks in Watson Assistant.

First, point your Skill’s webhook URL to https://neatnik.net/watson/assistant/webhook/ (this very page). No other headers or authorizations are needed.

Then:

  1. On any dialog node with the webhook enabled, set the Key and Value fields to what’s shown in the table above for your selected endpoint.
  2. Set the Return variable to response (it will automatically be prepended with a dollar sign).
  3. In the Assistant responds section, set "If assistant recognizes" to $response and set Respond with to $response.response. For the "anything_else" item, you can add whatever text you’d like to be shown if the webhook call fails.

Feedback & Help

I’d sincerely appreciate your feedback on this service. And I’m also happy to help if you run into any problems. Feel free to email adam@neatnik.net, or chat with me in the Watson Developer Community Slack (just search for my email address there). If you’re not already a member of the Slack, join here.