This demo sends error and resolution messages with Buttons and Cards to the logged-in user when that user toggles the simulated server. That user can interact with the Card buttons, and post comments back to the web page.
This showcases the art of the possible for handling notifications from APM Services like AppDynamics, Datadog, Splunk, Dynatrace and more!
View Demo
·
Report Bug
·
Request Feature
- To use this application as it exists in production, click here.
- Sign in with your Webex account credentials.
- Toggle the server switch.
- Check your Webex client. Toggling the switch should have caused the bot to sent you an alert card.
- Add a comment to the card.
- Submitting the comment should result in an update on the production page after a few seconds:
If you simply want to use this application, you only need to follow the Walkthrough.
Installation is only needed if you wish to host a version of this bot yourself.
- Python3 (v3.8.1)
- Clone the repo
git clone https://github.com/WXSD-Sales/BlurBackground.git
- Install the required python modules:
pip install pymongo==3.10.1 pip install pymongo[srv] pip install tornado==4.5.2 pip install requests pip install requests-toolbelt
- The following Environment variables are required for this demo, set with the appropriate values (see the Environment Variables section below for more details):
MY_BOT_ID=1234567890 MY_BOT_TOKEN=ABCDEFG-1234-567A_ZYX MY_SECRET_PHRASE=apmtestexample MY_BOT_PORT=10031 MY_CLIENT_ID=C51234567890 MY_CLIENT_SECRET=7851234567890 MY_BASE_URI=https://1234.eu.ngrok.io MY_REDIRECT_URI=/auth MY_SCOPES=spark%3Akms%20spark%3Apeople_read MY_MONGO_URL="mongodb+srv://username:password@your_instance.abcdef.mongodb.net/apm_demo?retryWrites=true&w=majority" MY_MONGO_DB=apm_demo
- Create the Webhooks (see below).
- Start the server
python apm_bot.py
MY_BOT_TOKEN
- login to the my-apps section of the developer portal
- Click "Create a New App"
- Select Bot
- Fill in the required fields You will be returned a unique bearer token for the bot.
MY_BOT_ID
This is actually the bot's personId (NOT application_id). To get the bot's personId,
- click here.
- Use the Try It editor on the right side of the page.
- toggle off the "Use personal access token" switch.
- paste the bot's token from step 1
- click Run The JSON returned will include an "id" property. This is the bot's personId.
MY_BASE_URI
- This will need to be a publicly accessible location where your bot will be exposed. You can use something like ngrok to provide a tunnel from your laptop or desktop to the world.
- You will use this value again when you create your webhooks, and will use it +
/auth
as the redirect_uri when you create the integration forMY_CLIENT_ID
andMY_CLIENT_SECRET
.
MY_REDIRECT_URI=/auth
MY_SCOPES=spark%3Akms%20spark%3Apeople_read
These can remain unchanged.
MY_CLIENT_ID
MY_CLIENT_SECRET
- login to the my-apps section of the developer portal
- Click "Create a New App"
- Select Integration
- Fill in the required fields.
a. Your redirect_uri value when creating this integration will need to be theMY_BASE_URI
+MY_REDIRECT_URI
values
b. For example, if you were to use the values given in the examples from the Installation step, your redirect_uri would be:
https://1234.eu.ngrok.io/auth
You will be returned a unique clientId and clientSecret when the application is created.
MY_MONGO_URL
You will need a MongoDB instance to store data. You can setup a free cluster using MongoDB Atlas.
Notice the url in the example wraps the string in quotation marks "
. Be aware of any special characters when setting the environment variables.
MY_MONGO_DB=apm_demo
This can remain unchanged. Remember to update the DB in the MY_MONGO_URL
string to match this value.
This application requires 2 webhooks. To create them through the developer portal click here.
1.Use the Try It Editor on the right side of the page
2.Untoggle the "Use my personal access token" switch
3.Paste the bot's token in that field.
4.Enter any name
5.targetUrl: Enter your BASE_URI
6.resource: messages
7.event: created
8.secret: Enter your MY_SECRET_PHRASE
value
Repeat this process a second time, to create an attachment Action webhook, will slight differences:
4.Enter any name
5.targetUrl: Enter your BASE_URI
+ /cards
6.resource: attachmentActions
7.event: created
8.secret: Enter your MY_SECRET_PHRASE
value
All contents are licensed under the MIT license. Please see license for details.
Everything included is for demo and Proof of Concept purposes only. Use of the site is solely at your own risk. This site may contain links to third party content, which we do not warrant, endorse, or assume liability for. These demos are for Cisco Webex usecases, but are not Official Cisco Webex Branded demos.
Please contact us at [email protected]