This is a Webex Messaging Bot which runs on the Webex Connect CPaaS platform. It leverages the Webex Connect Q&A Bot builder to respond to users queries and also can process Adaptive Card Actions via the flow and communicate with other integration services..
- Webex Connect Sandbox - Available to setup here: https://imimobile.com/products/webex-connect/sandbox
- Webex Messaging Bot Token - Guide available here: https://developer.webex.com/docs/bots
- On your Webex Connect Sandbox, navigate to the Bot builder in the App tray:
- At the top right, click
+ New Q&A Bot
:
- Give your Bot a name and click done:
- This will create a basic Q&A Bot with default articles and responses, you can add more responses to the Bot as needed.
-
Download the
sandbox.workflow
file from this repo -
Create a new Flow on your Webex Connect Sandbox and select the Upload a flow method and use the
sandbox.workflow
file -
Modify the Webhook and create a new Webex for this Flow and use the following JSON template and parse it:
{
"id": "This Webhook Notification event Ud in Base64 id",
"name": "Name of Webhook associated with the event",
"targetUrl": "This Webhook URL which this event notification is for",
"resource": "messages | membership | attachmentActions",
"event": "created | deleted",
"orgId": "Base64 Webex Org Id",
"createdBy": "Base64 person Id",
"appId": "Base64 Bot Id",
"ownedBy": "creator",
"status": "active",
"created": "2022-10-11T20:19:27.591Z",
"actorId": "Base64 person Id",
"data": {
"id": "Message/Membership/Action Base64 id",
"roomId": "RoomId Base64",
"roomType": "direct|group only available for message events",
"messageId": "MessageId given separate for Actions",
"personId": "Message creators personId Base64",
"personEmail": "user@example.com",
"created": "2022-10-13T17:31:28.884Z",
"parentId": "MessageId of the parent message, only available for a new message in a thread",
"type": "submit"
}
}
- Set the following conditions on the Webhook:
- Next, click on the Q&A Bot node within the flow designer
- Select Process Message and then select the Bot you created earlier. Ensure that the
$(messsageText)
and$(personId)
variables are set for the message and unique ID fields.
- Make sure that QnA Bots responses are saved to the
responses
flow variable under the Transitions Action On-Leave
- Save the flow changes and click make live. Set the Webex Messaging Bot as variable
Bearer <token>
and set the Bots name & email and update the support mailer.
- Create the Webex Webhook to point to the Webex Connect flows Webhook trigger so your Bot gets notified of any new Messages, Actions or Membership changes. More information available here: https://developer.webex.com/docs/webhooks
*For more demos & PoCs like this, check out our Webex Labs site.
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 use cases, but are not Official Cisco Webex Branded demos.
Please contact the WXSD team at wxsd@external.cisco.com for questions. Or, if you're a Cisco internal employee, reach out to us on the Webex App via our bot (globalexpert@webex.bot). In the "Engagement Type" field, choose the "API/SDK Proof of Concept Integration Development" option to make sure you reach our team.