Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with Sending .txt Attachments via Slack API #50

Open
mithunbharadwaj opened this issue Nov 17, 2023 · 1 comment
Open

Error with Sending .txt Attachments via Slack API #50

mithunbharadwaj opened this issue Nov 17, 2023 · 1 comment
Assignees

Comments

@mithunbharadwaj
Copy link
Contributor

mithunbharadwaj commented Nov 17, 2023

Description:

Encountered an error when attempting to send a Slack message with multiple attachments including a base64 image and a .txt file. The API returns an 'Unsupported conversion format ‘txt’' error, preventing the .txt file from being sent.

Expected behaviour:

Expected both the base64 image and the .txt file to be sent successfully as attachments in the Slack message.

Actual Behaviour:

The base64 image was sent successfully, but the API returned an error for the .txt file: 'Unsupported conversion format 'txt'

Body of API

{
   "body":{
      "template":"/Templates/Slack/message.md",
      "params":{
         "message":"I am testing a template"
      }
   },
   "attachments":[

      {
         "base64":"UklGRsoYAABXRUJQVlA4WAoAAAAIAAAA+QAA+QAAVlA4IOoXAABwYACdASr6APoAPm00lUekIyIhJ/KKMIANiWVu4W8g5uH9f+aT3vnj3j/U8RUcKF8/pl9PdKfQ/sPlfW/7SOzD2P8AjF7szQC95xNi+zaEvKLPC9+n98JnJ6kQ18apdSIa+NUupENfGqXUiGvjVLqRDXxJM7Jb1LUCafLu0c7i18QFzwcSzwsU/GmIx6Z7OscIFtV5r5kbTMa5MxVmSZcRU4QV7PcNzwntPTrtCmIatoif7a2KI+OkstKAPZ7PzjkszZJVI37fsq7QiL6kHk1g4uytS20pW0Tmam0uou1r6ibsTPXC72AoqDhI894NwvPXvJTgo5AG7sOenVqtQ3I9X4WnM1Vfuqyw/ZhgR/YFM62kkJjN0GKTP1l8e/paymVo1EZ9bUixqeS9w6nKJvHb1a50LMnQ6I+Ve4/RNJvhPECdQ5RoPlqBxcZvUS1mHOPXI3I7Veh7Pfy4Dhwy6Litkxwf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iOWBRpo8xW5TMUgd0pybcUCMeGk+dUaI5CplhS9ILSHN/kY07cAeQ7zgr/FfudCUorOkkzwaKPXPnz2eG23McrGTBGOfp+1QouvJTqahewU4LKjrhwSloKUhF1lKtgADlMjw3mPwHUrdWkujc1sgA7rAHBtpQAAAAAAAAAAAAAEVYSUa6AAAARXhpZgAASUkqAAgAAAAGABIBAwABAAAAAQAAABoBBQABAAAAVgAAABsBBQABAAAAXgAAACgBAwABAAAAAgAAABMCAwABAAAAAQAAAGmHBAABAAAAZgAAAAAAAAA4YwAA6AMAADhjAADoAwAABgAAkAcABAAAADAyMTABkQcABAAAAAECAwAAoAcABAAAADAxMDABoAMAAQAAAP//AAACoAQAAQAAAPoAAAADoAQAAQAAAPoAAAAAAAAA",
         "content-type":"image/jpeg",
         "filename":"kiwi.jpeg"
     },
     {
        "template":"/Templates/Attachment/attachment.md",     
        "format":"txt"
     }
   ]
}

Response:

{
    "result": "ERROR",
    "message": "Unsupported conversion format 'txt'.",
    "uuid": "e336c24a-d587-4145-905c-cf43c6e88cb7"
}

Additional Discovery
Upon further testing, I found that changing the order of attachments (placing the .txt file before the base64 image) results in a different behavior. In this case, the API returns the same 'Unsupported conversion format ‘txt’' error, but this time, the entire message and attachment are missing.

@ateska
Copy link
Contributor

ateska commented Nov 17, 2023

This is actually correct behaviour ... for now.

As a separate issue, MD->TXT conversion in attachments should be supported, there is .unformat() call in Markdown service now for this.
See

def unformat(self, markdown_str):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants