What is the correct input for the attachment in the Slack plugin?

What is the correct input for the attachment in the Slack plugin?

Trying to add a csv and it never agrees with me.

I believe it’s just base64 encoded. So take your CSV, run it through the base64 plugin to encode it, then use that output as the attachment for Slack.

Let us know if you have more questions.

thanks, still getting “malformed input” :face_with_symbols_over_mouth:

this URL is referenced in the plugin for how to use attachments, is a 404 now. https://api.slack.com/reference/message-attachments

it calls for a “JSON array of attachments”.

This is the layout:

I’m asking internally how to get the contents of the file in there. Give me a few minutes.

Ok, so the internal team got back to me. We do not actually support file attachments. Only “Slack Attachments.” The “Slack Attachment” is specially formatted text and such to include additional information.

We don’t support including file content in the attachment. (Slack doesn’t support it. It’s a different mechanism all together.)

So, with all that said, you could get around this by SCP’ing the file to another location, then posting the link to that file in your Chat Ops step.

Sorry for the confusion.