GithubHelp home page GithubHelp logo

meraki-webhooks-teams's Introduction

Meraki Webhooks Webex Teams Connector

Meraki Webhooks Webex Teams Connector

This application is designed to simplify the integration and delivery of Meraki Webhooks into Webex Teams.

webex-teams-integration

Contents

Prerequisites

If you don't already have a Webex Teams account, go ahead and register for one. They are free. You'll need to start by adding a new integration on the Webex Teams Developer site.

  1. Navigate to https://developer.webex.com, and click "Log in" near the top right.

developer-webex-com

  1. Log in to Webex using your credentials.

webex-login

  1. Click your profile picture at the top right, then select the "My Webex Teams Apps"

my-webex-teams-apps

  1. Click "Create an Integration"

create-an-integration-button

  1. Provide a Name for the Integration, your e-mail address and choose or Upload an Icon to represent the integration.

new-integration-a

  1. Enter a Description for the Integration. For the Redirect URI(s), enter the Public URL of your application, and append "/callback" to the end of it.

Note: If you plan on deploying to Heroku, you should start that process now so you can fill in variables as you go. Your Redirect URI for Heroku will be https://<your-app-name>.herokuapp.com/callback.

new-integration-b

  1. Select the Scopes for your Application. It requires the following scopes: "spark:rooms_read spark:rooms_write spark:memberships_read spark:memberships_write spark:people_read"

new-integration-c

  1. Click your profile picture again at the top right, then select the "My Webex Teams Apps"

my-webex-teams-apps

  1. Click "Create a Bot"

create-a-bot-button

  1. Provide a Name for the Bot, enter a Username and choose or Upload an Icon to represent the bot.

new-bot-a

  1. Enter a Description for the Bot.

new-bot-b

  1. Copy and store your Access Token - you will need this for your application.

new-bot-c

Meraki Dashboard Configuration


Enable your Meraki organization for API Access

  1. Log in to the Meraki Dashboard. Choose your organization if prompted to do so.

  2. On the left Navigation bar, go to Organization and select Settings.

  3. Scroll down to the Dashboard API Access section, and turn on API Access.

meraki-enable-api-access

Obtain your Meraki API Token

  1. Log in to the Meraki Dashboard. Choose your organization if prompted to do so.

  2. Under your username, select My profile

meraki-my-profile

  1. Scroll down to the API access section, and create an API key. You'll need it to get your Organization ID and to set your environment variables.

meraki-my-key

Application Installation

Heroku Installation is the recommended method. However, instructions are below for local installation if you prefer to run it in your private environment.

Cloud Installation - Heroku

Deploy

  1. If you do not already have a Heroku account, you can create one in the free tier. Otherwise, log in to your existing account.

  2. Enter a name for your application. Once you confirm that it is available, enter "https://<your-app-name>.herokuapp.com/" in the "BASE_URL" variable field. This also needs to go into the Redirect URI field for your Webex Teams Integration as "https://<your-app-name>.herokuapp.com/callback"

heroku-deploy

  1. The remaining fields will be populated as you create the Webex Integration and Bot

Local Installation

ngrok - Skip this step if you already have an Internet reachable web-server

ngrok will make easy for you to develop your code with a live bot.

If you are running a Mac with Homebrew, you can easily install via "brew cask install ngrok". Additional installation instructions can be found here: https://ngrok.com/download

After you've installed ngrok, in another window start the service

ngrok http 5000

You should see a screen that looks like this:

ngrok by @inconshreveable                                                                                                                                 (Ctrl+C to quit)

Session Status                online
Version                       2.2.4
Region                        United States (us)
Web Interface                 http://127.0.0.1:4040
Forwarding                    http://this.is.the.url.you.need -> localhost:5000
Forwarding                    **https://this.is.the.url.you.need** -> localhost:5000

Connections                   ttl     opn     rt1     rt5     p50     p90
                              2       0       0.00    0.00    0.77    1.16

HTTP Requests
-------------

POST /                         200 OK

Source

Create a virtualenv and install the module

virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
git clone https://github.com/meraki/spark-operations-bot.git

The easiest way to use this module is to set a few environment variables. On Windows, use "set" instead of "export". See the ngrok section below if you do not have a web server already facing the Internet. These are the Environment variables that are required to run the application (app.py):

export WEBEX_INTEGRATION_CLIENT_ID=<The Client ID of the Integration that you create in Webex Teams. Create a new Integration at https://developer.webex.com/my-apps/new/integration if you have not already done so.>
export WEBEX_INTEGRATION_CLIENT_SECRET=<The Client Secret of the Integration that you create in Webex Teams.>
export WEBEX_BOT_USERNAME=<The Username of the Bot that you create in Webex Teams. Create a new Bot at https://developer.webex.com/my-apps/new/bot if you have not already done so.>
export WEBEX_BOT_TOKEN=<The Token of the Bot that you create in Webex Teams.>
export BASE_URL=<The base address of your application. The public address of your Heroku app will be 'https://<your-app-name>.herokuapp.com/>

Now launch your bot!!

python app.py

Docker

First, make a copy of the .env.sample file, naming it .env, and editing it to set your environment variables.

Then build the container:

docker build -t joshand/meraki-webhooks-teams .
docker run -p 5000:5000 -it --env-file .env joshand/meraki-webhooks-teams

meraki-webhooks-teams's People

Contributors

joshand avatar

Stargazers

Shay Cheng avatar  avatar

Watchers

James Cloos avatar  avatar Shay Cheng avatar  avatar  avatar

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.