{"id":13764623,"url":"https://github.com/CiscoDevNet/botkit-webex-samples","last_synced_at":"2025-05-10T19:31:34.868Z","repository":{"id":40726538,"uuid":"78523648","full_name":"CiscoDevNet/botkit-webex-samples","owner":"CiscoDevNet","description":"Chatbot samples for Webex Teams built with Botkit","archived":false,"fork":false,"pushed_at":"2022-12-12T05:03:46.000Z","size":1692,"stargazers_count":45,"open_issues_count":12,"forks_count":44,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-14T21:53:56.568Z","etag":null,"topics":["botkit","chatbot","cisco-webex","webex-teams"],"latest_commit_sha":null,"homepage":"https://developer.cisco.com/site/spark","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CiscoDevNet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-10T10:37:30.000Z","updated_at":"2023-02-09T03:06:16.000Z","dependencies_parsed_at":"2023-01-27T13:46:40.625Z","dependency_job_id":null,"html_url":"https://github.com/CiscoDevNet/botkit-webex-samples","commit_stats":null,"previous_names":["ciscodevnet/botkit-ciscospark-samples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CiscoDevNet%2Fbotkit-webex-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CiscoDevNet%2Fbotkit-webex-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CiscoDevNet%2Fbotkit-webex-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CiscoDevNet%2Fbotkit-webex-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CiscoDevNet","download_url":"https://codeload.github.com/CiscoDevNet/botkit-webex-samples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253470960,"owners_count":21913765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["botkit","chatbot","cisco-webex","webex-teams"],"created_at":"2024-08-03T16:00:24.118Z","updated_at":"2025-05-10T19:31:34.573Z","avatar_url":"https://github.com/CiscoDevNet.png","language":"JavaScript","readme":"# botkit-webex-samples\n\nThis project implements a Botkit + Webex Teams adapter bot, based on the DevNet [botkit-template](https://www.github.com/CiscoDevNet/botkit-template) project, providing some additional interesting samples and examples:\n\n- `emoji.js`- Converts emoji tags into unicode characters and returns the \"emojified\" phrase\n\n- `events.js` - Retrieve/display DevNet event details from an HTTP REST API providing JSON data\n\n- `roomid-phantom.js` - Helpful utility bot; when added to a room, it creates a separate space with the requestor and outputs the roomId of the original room\n\n- `roomkit.js` - Interact with a Cisco room device via xAPI/jsxapi.  Query the device's 'PeopleCount' function, or execute an ad hoc 'xStatus' CLI command\n\n- `survey.js` - Implements a basic survey, posting survey data into a cloud service (i.e. Webex Teams) via an external REST API \n\n## Websockets vs. Webhooks\n\nMost Botkit features can be implemented by using the Webex Teams JS SDK websockets functionality, which establishes a persistent connection to the Webex Teams cloud for outbound and inbound messages/events.\n\nWebex Teams also supports traditional HTTP webhooks for messages/events, which requires that your bot be accessible via a publically reachable URL.  A public URL is also needed if your bot will be serving any web pages/files, e.g. images associated with the cards and buttons feature or the health check URL.\n\n- If you don't need to serve buttons and cards images, you can set the environment variable `WEBSOCKET_EVENTS=True` and avoid the need for a public URL\n- If you are implementing buttons \u0026 cards, you will need a public URL (e. g. by using a service like Ngrok, or hosting your bot in the cloud) - configure this via the `PUBLIC_URL` environment variable \n\n## How to run (local machine)\n\nAssuming you plan to us [ngrok](https://ngrok.com) to give your bot a publically available URL (optional, see above), you can run this template in a jiffy:\n\n1. Clone this repo:\n\n    ```sh\n    git clone https://github.com/CiscoDevNet/botkit-webex-samples.git\n\n    cd botkit-webex-samples\n    ```\n\n1. Install the Node.js dependencies:\n\n    ```sh\n    npm install\n    ```\n\n1. Create a Webex Teams bot account at ['Webex for Developers'](https://developer.webex.com/my-apps/new/bot), and note/save your bot's access token\n\n1. Launch Ngrok to expose port 3000 of your local machine to the internet:\n\n    ```sh\n    ngrok http 3000\n    ```\n\n    Note/save the 'Forwarding' HTTPS address that ngrok generates\n\n1. Rename the `env.example` file to `.env`, then edit to configure the settings and info for your bot.  Individual features included in this project may need specific configurations in `.env` (see the comments at the top of each feature `.js` file for details.)\n\n    \u003eNote: you can also specify any of these settings via environment variables (which will take precedent over any settings configured in the `.env` file)...often preferred in production environments\n\n    To successfully run all of the sample features, you'll need to specify at minimum a `WEBEX_ACCESS_TOKEN` (Webex Teams bot access token), and either a `PUBLIC_URL` or enable `WEBSOCKET_EVENTS`.\n\n    \u003eNote: If running on Glitch.me or Heroku (with [Dyno Metadata](https://devcenter.heroku.com/articles/dyno-metadata) enbaled), the `PUBLIC_URL` will be auto-configured\n\n    Additional values in the `.env` file (like `OWNER` and `CODE`) are used to populate the healthcheck URL meta-data.\n\n    Be sure to save the `.env` file!\n\n1. You're ready to run your bot:\n\n    ```sh\n    node bot.js\n    ```\n\n## Quick start on Glitch.me\n\n* Click [![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg)](https://glitch.com/edit/#!/import/github/CiscoDevNet/botkit-template)\n\n* Open the `.env` file, then uncomment the `WEBEX_ACCESS_TOKEN` variable and paste in your bot's access token\n\n    **Optional**: enter appropirate info in the \"Bot meta info...\" section\n\n    \u003eNote that thanks to Glitch `PROJECT_DOMAIN` env variable, you do not need to add a `PUBLIC_URL` variable pointing to your app domain\n\nYou bot is all set, responding in 1-1 and 'group' spaces, and sending a welcome message when added to a space!\n\nYou can verify the bot is up and running by browsing to its healthcheck URL (i.e. the app domain.)\n\n## Quick start on Heroku\n\n* Create a new project pointing to this repo.\n\n* Open your app settings, view your config variables, and add a `WEBEX_ACCESS_TOKEN` variable with your bot's access token as value.\n\n* Unless your app is using [Dyno Metadata](https://devcenter.heroku.com/articles/dyno-metadata), you also need to add a PUBLIC_URL variable pointing to your app domain.\n\n![](assets/images/heroku_config-variables.png)\n\nYou bot is all set, responding in 1-1 and 'group' spaces, and sending a welcome message when added to a space!\n\nYou can verify the bot is up and running by browsing to its healthcheck URL (i.e. the app domain.)","funding_links":[],"categories":["Code samples"],"sub_categories":["Bot samples"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCiscoDevNet%2Fbotkit-webex-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCiscoDevNet%2Fbotkit-webex-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCiscoDevNet%2Fbotkit-webex-samples/lists"}