12-10-2022 07:38 PM
HI team,
I created a Webex Webhook through API to capture message event in a specific room (group) which includes me and my bot, and got successful result as below:
{
"id": "Y2lzY29zcGFyazovL3VzL1dFQkhPT0svYzlmOWQ1N2EtODMxMi00NDdjLWIyMjctNThkMGNhM2M2NDBl",
"name": "lintlin_bot_sxo_webhook",
"targetUrl": "https://securex-ao.apjc.security.cisco.com/webhooks/02215WZUIP4XY3AlVuAvdQk2NRHQuDjqQIv?api_key=Xar7fTFkSxykdF25rKblGU01ubhMpaCRF2c1GuGRkoyKgBNSu+vmV3qbADsI4MvnQBVz/YVJ0iDcgkc+y6k6vFsyUwWwu+UOLaL8BBbAE1aQxeV+d2cQo5q/nqOxm4VGcn6ukhmw0kDqLfluy0CiZFiLbc...",
"resource": "messages",
"event": "created",
"filter": "roomId=Y2lzY29zcGFyazovL3VzL1JPT00vYmM1NDU0ZTAtNjQ5OS0xMWVjLTllYjctY2JiMjFlMjNjOTBm",
"orgId": "Y2lzY29zcGFyazovL3VzL09SR0FOSVpBVElPTi8xZWI2NWZkZi05NjQzLTQxN2YtOTk3NC1hZDcyY2FlMGUxMGY",
"createdBy": "Y2lzY29zcGFyazovL3VzL1BFT1BMRS9jMTEzZDg1ZC1lNGVkLTQ0NTktOTM0OC1hNGI0ZmYyOGZkMGI",
"appId": "Y2lzY29zcGFyazovL3VzL0FQUExJQ0FUSU9OL0NmMzkyNWU5NDFmMzhhYTc0M2Y0MmFiNzcwZmZhZjFhNTIyMjcxZDI5OTQ4NDhjNjk2YWMwYTEwN2Q2YTg5MjI3",
"ownedBy": "creator",
"status": "active",
"created": "2022-12-11T03:17:57.184Z"
}
However, not matter who, me or the bot, sends out a message, the webhook always can't receive any notification from Webex.
I've verified my webhook on SXO by using Postman, it can receive the notification without any problem. So I think the issues should be on Webex side.
Not sure what is the root cause? or what steps are missed to let it work?
PS: I also tested direct type room, doesn't work either.
Thanks,
Lin Tao
12-12-2022 12:24 AM
@lintlin it seems then, that your URL is not completely public, maybe it needs a Cisco machine or something. If this is the case you can look into using websockets: https://developer.webex.com/blog/using-websockets-with-the-webex-javascript-sdk
12-11-2022 07:34 AM
@lintlin to me it doesn't seem like the https://securex-ao.apjc.security.cisco.com/webhooks/02215WZUIP4XY3AlVuAvdQk2NRHQuDjqQIv?api_key=Xar7fTFkSxykdF25rKblGU01ubhMpaCRF2c1GuGRkoyKgBNSu+vmV3qbADsI4MvnQBVz/YVJ0iDcgkc+y6k6vFsyUwWwu+UOLaL8BBbAE1aQxeV+d2cQo5q/nqOxm4VGcn6ukhmw0kDqLfluy0CiZFiLbc... address is publicly available.
See https://developer.webex.com/docs/webhooks#webex-webhooks :
Please note, that this URL must be publicly reachable and Internet-accessible by Webex, where your application will be listening for inbound HTTP requests.
Being available inside the Cisco network does not count, it has to be fully public. Try with another target URL like https://webhook.site/ , that will confirm whether the issue is on the Webex side, or with the URL you are using.
12-11-2022 05:27 PM
@Janos Benyovszki , thanks, I just tried https://webhook.site/ , yes, it works, after typing a message in the room, I can see a notification received on that website, which was sent from Webex. However, I think SXO URL shoule publicly available. Because when I tested it through Postman by sending a HTTP request from out side Cisco to this SXO URL, I can get the successful response. In addition, I am using SXO as a Webhook to receive notifications sent from Thousands Eyes cloud. It works well too.
So, just wondering, does Webex have any special requirements for Webhook URL?
Thanks
12-11-2022 01:40 AM
Thanks, actually this Webhook was created by me not by Bot.
I also did test a bot-created Webhook for this group room, however that webhook still can't be triggered even the bot was mentioned (@) in messages.
12-11-2022 01:14 AM
Who created the webhook? Was it the bot? If so, the webhook will be only triggered if the bot is mentioned in a message, see https://developer.webex.com/docs/bots#differences-between-bots-and-people
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide