From 2bc4c75b31b72d611c531442dd0ff0de5f770938 Mon Sep 17 00:00:00 2001 From: "Neidinger, Marcel" Date: Tue, 27 Oct 2020 12:32:18 +0100 Subject: [PATCH 1/2] fixed typo that checked the list instead of the enumerated attachment for the AdaptiveCards Type --- webexteamssdk/api/messages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webexteamssdk/api/messages.py b/webexteamssdk/api/messages.py index b0a9916..c38b561 100644 --- a/webexteamssdk/api/messages.py +++ b/webexteamssdk/api/messages.py @@ -200,7 +200,7 @@ def create(self, roomId=None, toPersonId=None, toPersonEmail=None, for item, attachment in enumerate(attachments): check_type(attachment, (dict, AdaptiveCard)) - if isinstance(attachments, AdaptiveCard): + if isinstance(attachment, AdaptiveCard): attachments[item] = make_attachment(attachment) post_data = dict_from_items_with_values( From 25dabe9566b71a4307d351e55571ad802b7e94c2 Mon Sep 17 00:00:00 2001 From: "Neidinger, Marcel" Date: Tue, 27 Oct 2020 12:33:44 +0100 Subject: [PATCH 2/2] Changed docs to include correct call path for sending cards --- docs/user/cards.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/cards.rst b/docs/user/cards.rst index 9c7a369..957f2db 100644 --- a/docs/user/cards.rst +++ b/docs/user/cards.rst @@ -31,7 +31,7 @@ Lets dive into a simple example that sends a card to a room card = AdaptiveCard(body=[greeting, first_name, age], actions=[submit]) api = WebexTeamsAPI() - api.messages.create(text="fallback", roomId="...", cards=card) + api.messages.create(text="fallback", roomId="...", attachments=[card]) The message we send with this code then looks like this in our Webex Teams client: