webex teams integrations · talk to webex teams via apis api cisco webex teams rest api get post...

55
Presenter: Christina Skoglund, Technical Solutions Specialist, [email protected] Panel: Alvaro Ramos Gutierrez, Technical Solutions Specialist, [email protected] April 2020 How to get started Webex Teams Integrations

Upload: others

Post on 06-Aug-2020

33 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

Presenter: Christina Skoglund, Technical Solutions Specialist, [email protected]: Alvaro Ramos Gutierrez, Technical Solutions Specialist, [email protected] 2020

How to get startedWebex Teams Integrations

Page 2: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved. © 2020 Cisco and/or its affiliates. All rights reserved.

Agenda

Ø Introduction

ØPOSTMAN to interact

ØTwo different Bot types

ØAutomate workflows

without coding!

Page 3: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

What is an API?

Page 4: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Application Programming Interface (API)

“It’s a way for two pieces of software to talk to each other”

Page 5: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

SaaS/Cloud Service

application

REST API

GET

POST

PUT

DELETE

Response JSON …

API

https://developer.cisco.com/learning/devnet-express/dnav4-track/rest-api-fundamentals/what-are-rest-apis/step/1

Page 6: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

application

REST API

GET

POST

PUT

DELETE

Response JSON

API

Cisco Webex Teams

https://developer.cisco.com/learning/devnet-express/dnav4-track/rest-api-fundamentals/what-are-rest-apis/step/1

Page 7: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Application interaction with Postman

Great place to start if you are a beginner!!

Page 8: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Use Postman to interact with Webex Teams via APIs!

Beginner?

www.postman.com

Page 9: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Webex Teams APIs

www.developer.webex.com

Page 10: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Talk to Webex Teams via APIs

API

Cisco Webex Teams

REST API

GET

POST

List of rooms

New message

Response JSON …

Page 11: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Chat Ops with Webex Teams and Python

Great place to start if you have some

basic Python experience

Page 12: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

2 Bot use cases

Notification Bots Controller Bots

API

Cisco Webex Teams

Page 13: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Controller Bots – “A modern CLI”

API

Bot

Cisco Webex Teams

controller

Give me informationTake specific action…

Page 14: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

• Two-Way Communication: Systems <-> Chat Rooms • Requires an Internet Accessible Application• DevOps: Request Reports, View Issue Details• SysAdmin: Execute Scripts, Dig Into Alert Data

Controller Bots – “A modern CLI”

Page 15: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

• Two-Way Communication: Systems <-> Chat Rooms • Requires an Internet Accessible Application• DevOps: Request Reports, View Issue Details• SysAdmin: Execute Scripts, Dig Into Alert Data

Controller Bots – “A modern CLI”

HOW DO I GET THERE?

Page 16: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

How do I get the intelligence?

Page 17: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

How do I get the intelligence?

WHAT IS THE MAGIC?

Page 18: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Architecture – Let’s break it down with easy example

Cisco Webex Teams

hello

“hello”URL

“Hi there!”

Page 19: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

The four magic ingredients:

WebhooksPython script

1.

2.

3.

4.

Webex Teams Bot

Page 20: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

1. Create Webex Teams Bot

Cisco Webex Teams

Page 21: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

1. Create a Webex Teams BotCreate a bot

www.developer.webex.com and log inMy Webex Apps > Create a New App > Create Bot

>>Save Bot’s token and id<<

Page 22: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

2. The Bot’s brain

Cisco Webex Teams

hello

Bot’s brain = A Python script

Page 23: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

2. Python script

• We need our Bot to have a brain

• All logic will be defined in this Python script

• Create a web application with Flask

• Python and Flask are just one example, there are many ways of doing this

• Webex Teams SDK

Page 24: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

2. Python script

Import Python libraries

Define Flask application

Define the logic of the app

Run Flask application

Import Flask, webexteamssdk

Flask application

The Bot’s brain

Run it!

Structure the Python code!

Page 25: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

2. Python script

Libraries:• Flask• webexteamssdk

$pip install flask$pip install webexteamssdk

TRY THIS!

Page 26: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

3. Python Script Needs Internet Access!

Cisco Webex Teams

hello

Bot’s brain = A Python script

URL

Page 27: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

3. Deploy in Heroku

URL

• Heroku is a PaaS that enables developers to build, run and operate applications in the cloud

• We need a publicly accessible URL!

• Many ways of doing this

• www.heroku.com

Page 28: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

3. Deploy app in Heroku

Page 29: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

• Make sure you have a “Procfile”

• Make sure you have gunicorn and heroku installed

3. Deploy app in the Heroku cloud

$pip install gunicorn$pip install heroku

web: gunicorn <scriptname>:app

For YourReference

Page 30: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Webex Teams Bot to communicate with brain!

hello

“hello”URL Cisco Webex Teams

Page 31: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

“A webhook (also called a web callback or HTTP push API) is a way for an app to provide other applications with real-time information”

4. Webhook

Page 32: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

4. Webhook – how to create it for a bot

Create a webhookwww.developer.webex.com and log inDocumentation > API Reference > Webhooks

Page 33: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

4. Webhook – how to create it for a bot

Page 34: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Bot’s token!

Add your app’s URL

Page 35: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Architecture – Let’s break it down

Cisco Webex TeamsWebhook: ‘hello’

1.

2.POST “Hi There!”

URL

Page 36: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Architecture

Cisco Webex Teams

How many APs?

Cisco DNA Center

GET:# of AP

Webhook: ‘How many APs?’

POST: “32”

1.

3.

2.URL

Page 37: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Architecture

Cisco Webex Teams

How many APs?

Cisco DNA Center

GET:# of AP

Webhook: ‘How many APs?’

POST: ‘32

1.

3.

2.

How many APs?

32

URL

Page 38: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Notification Bots

API

Cisco Webex Teams

application

Notification

Page 39: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

• One-way communication: systems -> chat rooms • Simple architecture: anything that can HTTP POST• DevOps: GitHub, Jenkins, Ant, Maven• SysAdmin: alerts, status, tickets

Notification Bots

Page 40: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Notification Bots

Cisco Webex Teams

Cisco DNA Center

WLC reboots

Event triggered in Cisco DNAC

Cisco DNAC notifies Cisco Webex Teams

Page 41: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Notification Bots

Cisco Webex Teams

Cisco DNA Center

WLC reboots

Event triggered in Cisco DNAC

Cisco DNAC notifies Cisco Webex Teams

WHAT IS THE MAGIC?

Page 42: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

WEBHOOKS!

Page 43: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Subscribe to events in DNAC

2 Subscribe

Go to Events and choose event1

Page 44: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Subscribe to events in DNAC

2 Subscribe

Go to Events and choose event1

URL

Page 45: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Notification Bots

Cisco Webex Teams

Cisco DNA Center

WLC reboots

2. Event triggered in Cisco DNAC

Cisco DNAC notifies Python application

3. WebhookPOST

1. Event4.

URL

Page 46: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Easy way to automate your integrations…

Integration Platform as a Service (iPaaS)

Page 47: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Integration Platform as a Service (iPaaS)

Page 48: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Example – integrate two applications

New folder added Create new message

Page 49: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Automate workflows without any code!

Page 50: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Automate workflows without any code!

Bot’s RoomID

Page 51: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

What have we talked about?

- Get started with Postman and APIs

- Create your own Controller Bot

- Create your own notification Bot

- Automate integration between Applications

Page 52: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

• www.developer.cisco.com

• Setup your developing environment:https://developer.cisco.com/learning/devnet-express/devnet-express-cloud-collab-it-pro/devnet-express-event-setup-itp/collab-dne-event-setup-itp/step/1

• Python Programming Basics for Cloud Collab IT Pros (lab):https://developer.cisco.com/learning/modules/devnet-express-python-programming-basics-ccitp/collab-tools-intro-to-git-itp/step/1

• Flask web application Documentation:https://flask.palletsprojects.com/en/1.1.x/

• Heroku:www.heroku.com

• Webex Teams Python SDK Documentation:https://webexteamssdk.readthedocs.io/en/latest/

• Bot Hosting Services:

www.Gupshup.io , www.Zenbot.org

• Google Dialogflow:www.dialogflow.com

Resources – where to learn more!

Page 53: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

Q&A

54

Page 54: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin:

© 2020 Cisco and/or its affiliates. All rights reserved.

UP-TO-SPEED Cisco WirelessC9800 Wireless controllerne, Wi Fi 6 + designs Afholdes Torsdag den 16. april fra kl. 10 – 11

Page 55: Webex Teams Integrations · Talk to Webex Teams via APIs API Cisco Webex Teams REST API GET POST List of rooms New message ... •DevOps: Request Reports, View Issue Details •SysAdmin: