Skip to content

Commit ac337fa

Browse files
author
Brad Haas
committed
add attachment contetType if it does not exist
1 parent abd1d5d commit ac337fa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

webexteamssdk/api/messages.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,14 @@ def create(self, roomId=None, toPersonId=None, toPersonEmail=None,
188188
"message.")
189189
check_type(files[0], basestring)
190190

191+
if attachments:
192+
for attachment in attachments:
193+
try:
194+
content_type_exists = attachment['contentType']
195+
except Exception as e:
196+
# ensure a valid header is loaded for cards
197+
attachment['contentType'] = 'application/vnd.microsoft.card.adaptive'
198+
191199
post_data = dict_from_items_with_values(
192200
request_parameters,
193201
roomId=roomId,

0 commit comments

Comments
 (0)