Webhook Response JSON (adaptive card) - 500 Internal Server Error

Hello Forum,

i’m using the webex teams connector to communicate with webex teams. Communication with simple text is working fine. I can also send a json for creating an adaptive card. The adaptive card is shown properly in webex teams.

But here is my problem. When i’m clicking the “Submit”-Button, the webex response leads to an “500 internal server error” error. And i have no idea why.

The json-response from a simple “Hello” looks similar to a json-response from a “Submit”, execpt {…“resource”: “messages”…} instead {…“resource”: “attachmentActions”…} in the response.

In case of a “hello” - i have configured the intent “greet” and an action which sends the adaptive card. I assume that rasa receives an simple “hello” with a json payload.

In case of click the “Sumbit”-Button i’m not sure what webex sends to rasa.

Any idea what’s wrong? And how can i see what rasa is receiving. In the logfile i can find just the error message.

Best regards Mirko

This is the json which comes with the “hello” - Server 200 OK

{
    "id": "Y2lzY29zcGFyazo....",
    "name": "Webhook msg",
    "targetUrl": "https://abcd.ngrok.io/webhooks/webexteams/webhook",
    "resource": "messages",
    "event": "created",
    "orgId": "abcd....",
    "createdBy": "abcd....",
    "appId": "abcd....",
    "ownedBy": "creator",
    "status": "active",
    "created": "2021-04-26T16:19:19.930Z",
    "actorId": "abcd....",
    "data": {
        "id": "abcd....",
        "roomId": "abcd....",
        "roomType": "group",
        "personId": "abcd....",
        "personEmail": "mybot@webex.bot",
        "created": "2021-04-26T16:19:41.134Z"
    }
}

This is the json which comes from the “Submit” - Server 500 Internal Server Error

{
    "id": "Y2lzY29zcGF....",
    "name": "Webhook attA",
    "targetUrl": "https://abcd.ngrok.io/webhooks/webexteams/webhook",
    "resource": "attachmentActions",
    "event": "created",
    "orgId": "abcd....",
    "createdBy": "abcd....",
    "appId": "abcd....",
    "ownedBy": "creator",
    "status": "active",
    "created": "2021-04-26T16:16:31.617Z",
    "actorId": "abcd....",
    "data": {
        "id": "abcd....",
        "type": "submit",
        "messageId": "abcd....",
        "personId": "abcd....",
        "roomId": "abcd....",
        "created": "2021-04-26T16:25:54.942Z"
    }
}

And this is from the rasa logfile

2021-04-26 18:25:55,375 [DEBUG] Received webex webhook call 2021-04-26 18:25:55,384 [DEBUG] Resetting dropped connection: webexapis.com 2021-04-26 18:25:55,755 [DEBUG] https://webexapis.com:443 “GET /v1/messages/Y2lzY29zcGFyazovL… HTTP/1.1” 404 None 2021-04-26 18:25:55,758 [ERROR] Exception occurred while handling uri: ‘http://abcd.ngrok.io/webhooks/webexteams/webhook’ Traceback (most recent call last): File “/home/user1/rasa/lib/python3.8/site-packages/sanic/app.py”, line 938, in handle_request response = await response File “/home/user1/rasa/lib/python3.8/site-packages/rasa/core/channels/webexteams.py”, line 116, in webhook message = self.api.messages.get(webhook_obj.data.id) File “/home/user1/rasa/lib/python3.8/site-packages/webexteamssdk/api/messages.py”, line 321, in get json_data = self._session.get(API_ENDPOINT + ‘/’ + messageId) File “/home/user1/rasa/lib/python3.8/site-packages/webexteamssdk/restsession.py”, line 380, in get response = self.request(“GET”, url, erc, params=params, **kwargs) File “/home/user1/rasa/lib/python3.8/site-packages/webexteamssdk/restsession.py”, line 345, in request check_response_code(response, erc) File “/home/user1/rasa/lib/python3.8/site-packages/webexteamssdk/utils.py”, line 222, in check_response_code raise ApiError(response) webexteamssdk.exceptions.ApiError: [404] Not Found - The requested resource could not be found. [Tracking ID: ROUTER_6086E993-BEC4-01BB-03D8-0AFDC6F403D8]

Hello Rasa-Team,

now i know what happened. And i think this is a case for your developers for a future version of the webex-channel.

When you send a regular text-message (e.g. “hello”), webex sends this message via the webex-webhook with resource “message”. The received json in the webhook_obj (in webexteamssdk.py) looks like…

{… “resource”: “message”,… }

Now the sdk make a request against the webex webhook to request the message details

Webexapi.com

So far so good.

But when you click a “Submit”-Button in an adaptiveCard, the webex-Webhook sends a json via the webex-webhook with resource “attachmentAction”. The received json in the webhook_obj (in webexteamssdk.py) looks like…

{… “resource”: “attachmentAction”,… }

But now the sdk makes again a request against (Webexapi.com) to receive the message Details. But this is wrong. In this case the request should go against

Webexapi.com

This leads to an “404 Not Found” Error" and rasa sends an “500 Internal server error” back to webex.

Maybe your developers can pimp this channel in a future version.

Thanks Mirko

Hello,

Were you able to solve the problem, if yes, can you please share the solution & related details.

Thanks! Akki