Giter Site home page Giter Site logo

watson-assistant-webhooks-tutorial-part-ii's Introduction

🚀 Watson Assistant & Webhooks Tutorial Part II

In this hands-on tutorial you will create a demo for Watson Assistant that is able to create a ticket if you have any problems. This ticket is then saved to a Cloudant database and you can verify the ticket status. The language of this Watson Assistant dialog skill is german.

Prerequisites

  1. Sign up for an IBM Cloud account.
  2. Fill in the required information and press the „Create Account“ button.
  3. After you submit your registration, you will receive an e-mail from the IBM Cloud team with details about your account. In this e-mail, you will need to click the link provided to confirm your registration.
  4. Now you should be able to login to your new IBM Cloud account ;-)

Digital Tech Tutorial Watson Assistant Webhooks Part I and II

This tutorial consists of 2 parts, you can start with part I or II.
Part I - Watson sends a reminder via e-mail
Part II - Watson creates a ticket and saves it to a Cloudant database

Set up the Cloudant DB

After the login you will see your IBM Cloud Dashboard. Go to Catalog and select the Databases category or search for Cloudant. Then create a new Cloudant, the Lite Plan should work for this tutorial. As Authentication method choose IAM.

Create Cloudant DB

In your IBM Cloud Account go to the dashboard by clicking the IBM Logo in the upper left. Click on your new Cloudant service and select Service credentials to create new credentials. Copy them by clicking the copy button and save them for later.

Create Service Credentials

Now go to Manage (above Service credentials), click Launch Dashboard and create a new non-partitioned Database (just dont tick the partitioned-button). Remember your database name for later. (Optionally you can also create your database from a Terminal using your credentials or in a later step from your cloud function).

Create Database

Set up the cloud function

Go back to your IBM Cloud Dashboard. Click the Cloud Functions button, then go to Actions and click create, to create a new action.

Cloud Functions Button

Give your action a name, keep the Default Package and choose Node.js as your runtime. Click create.

Create Cloud Function Action

Copy and paste the ticket-system-with-cloudant-db.js code and provide your credentials and database name. From your credentials copy and paste the url and apikey. Then copy and paste your database name.

Provide Credentials DB

Now you can test your Cloud Function to make sure everything works fine. Therefore save it and click Invoke with Parameters, provide the input below, and click Apply, then click Invoke. Results are shown in the Activations pane. (HD in the description stands for help desk).

{
  "ticketOperation": "createTicket",
  "ticketStatus": "open", 
  "ticketDescription": "HD my email is not working",
  "ticketContact": "[email protected]"
}

Test Cloud Function

After testing you should see a new entry generated in your Cloudant database. Go to Endpoints, enable it as a Web Action, save and copy the provided URL. You will need it later on, when setting up your Watson Assistant.

Create Endpoint Web Action

Set up Watson Assistant on the IBM Cloud

In your IBM Cloud Account go to the dashboard by clicking the IBM Logo in the upper left. Go to Catalog and select the AI / Machine Learning category under services or search for Watson Assistant. Then create a new Watson Assistant service, the Lite Plan should work for this tutorial.

Create Watson Assistant

Afterwards launch your Watson Assistant Service, you will find it on your dashboard under services.

Go to skills and create a new skill, when asked choose the dialog skill. Select import skill and upload the skill-Help-Desk-Webhook-and-CF.json file.

If you can't find skills, click on the profile icon in the upper right corner, and click Switch to classic experience.

Import Skill

Click options and then select Webhooks. Provide the Web Action URL you obtained when creating the Endpoint. Make sure to add a .json at the end.

Add Webhook with JSON

Now you can go to the dialog and try it out for yourself. You can create a new ticket or verify the status of an existing ticket.

Try it Out

watson-assistant-webhooks-tutorial-part-ii's People

Contributors

felixaugenstein avatar felixwidmann avatar janhofmann01 avatar

Forkers

janhofmann01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.