oracle digital assistant - github pages · 2020-04-09 · •webhooks and oracle digital assistant...

28

Upload: others

Post on 13-Apr-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that
Page 2: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |

Oracle Digital Assistant The Complete Training

2

Webhook

Image courtesy of pixabay.com

Page 3: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

Safe Harbor StatementThe following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

3

Page 4: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

Topic agenda

Overview

Creating webhook clients with Node.js

Creating a webhook channel

1

2

3

4

Page 5: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

Topic agenda

Overview

Creating webhook clients with Node.js

Creating a webhook channel

1

2

3

5

Page 6: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

About webhooks and their use with chatbots• Programming interfaces implemented by a system on the web – Allows other programs to subscribe and receive automated notification

• Accessing chatbots using Webhooks– Users access chatbots through a messenger –Webhook are "client adapters" that dispatch and manage conversation between

messenger channels and chatbots

• Webhooks and Oracle Digital Assistant– You use webhooks to access Oracle Digital Assistant for messenger channels that

there is no native channel support provided for

6

Page 7: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 7*https://memegenerator.net/

Page 8: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 8

MessengerPlatform

Client App

GenericMessenger

PlatformServer

Oracle Digital

Assistant

HTTP POST

Async Response Async Response

Generic HTTP webhook channel

HTTP POST

Page 9: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

• Bot channel publishes an HTTP Endpoint to receive messages• You define a response HTTP

Endpoint• Bot will send response messages

back to your server

• To verify messages Oracle Digital Assistant generates and uses a secret key• Caller must supply– X-Hub-Signature HTTP header– Set to SHA256 signature of payload– Secret key used as SHA key

• Uses same mechanism on response–Optional for caller to verify payload

9

Generic HTTP webhook support

Page 10: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

Topic agenda

Overview

Creating webhook clients with Node.js

Creating a webhook channel

1

2

3

10

Page 11: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

Building steps for Oracle Digital Assistant• Download Oracle Bots Node.js SDK• Create a webhook client project• Implement webhook client code for messages received from messenger• Create a webhook channel in Oracle Digital Assistant– Associate channel with digital assistant or skill

• Reference webhook channel in webhook client

11

Page 12: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 12

The Oracle Bots Node.js SDK makes it easy to build webhook clients for

Oracle Digital Assistant.

Image courtesy of pixabay.com

Page 13: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

Oracle Bots Node.js SDK

• Bots Node.js SDK functionality– Custom component development–Webhook client development

• Webhook development support– Assists in building webhook clients that dispatch between messengers and bots• E.g. Alexa integration

– Generates the SHA256 signature and sets X-Hub-Signature header

13

https://github.com/oracle/bots-node-sdk

Page 14: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 14

Download Ortacle Bots Node.js SDKGetting started with your webhook development 1 of 4

Page 15: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 15

Extract ZIP and navigate to bots-node-sdk-master/examples/webhook/starter folderGetting started with your webhook development 2 of 4

Page 16: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 16

Copy content of started folder to your custom project folder Getting started with your webhook development 3 of 4

Webhook client

Node Express serverNode dependencies

Page 17: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

Getting started with your webhook development 4 of 4

• Install project– npm install– Npm install –save @oracle/bots-node-sdk

17

Page 18: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

Exploring the 'service.js' webhook client

18

Page 19: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 19

Running the project

Page 20: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

Topic Agenda

Overview

Creating Webhook clients with Node.js (build, configure)

Creating a webhook channel

1

2

3

20

Page 21: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

Oracle Digital Assistant – Creating a webhook channel

21

Page 22: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

Oracle Digital Assistant – Creating a webhook channel

22

Outgoing Webhook URI:https://niaqnaalexabot-ocloud109.apaas.us2.oraclecloud.com/apps/alexa-singleBot/singleBotWebhook/messages

Page 23: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

Oracle Digital Assistant – Creating a webhook channel

23

Page 24: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

Oracle Digital Assistant – Creating a webhook channel

24

Secret Key and Webhook URL will be passed in skill code configuration

Page 25: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 25

You find a complete webhook example for Alexa voice integration

on the Oracle TechExchange blog

Image courtesy of pixabay.com

https://blogs.oracle.com/mobile/tech-exchange

Page 26: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 26

Page 27: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that
Page 28: Oracle Digital Assistant - GitHub Pages · 2020-04-09 · •Webhooks and Oracle Digital Assistant –You use webhooks to access Oracle Digital Assistant for messenger channels that

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 28

Oracle Digital Assistant Hands-On

TBD