Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I post a snippet to slack channel

I am trying to post log info to slack and some of these logs can get pretty big. Is there a way to send it as a snippet so that slack doesn't chunk the text into multiple messages?

like image 974
Jerrod Horton Avatar asked Oct 24 '16 23:10

Jerrod Horton


People also ask

How do I attach a snippet?

Open your message, make sure your cursor is clicked into the message body, and then choose the Insert menu. Click on the Screenshot icon. You'll see options to screenshot any open windows you have. You can also choose Screen Clipping at the bottom.

What is a Slack snippet?

Snippet Templates for Slack Stop typing the same repeat messages. Sapling's Snippets product allows individuals and teams to instantly re-use common phrases and messages on any text input. The templates can be inserted through an inline search pane, or used as a macro via a shortcut text expansion.

How do I copy and paste in Slack?

Click the three dots icon and choose Copy link. Paste the link into the message field, add text of your own if you'd like, and press Enter to send it.

How do you make a snippet?

You can also insert a snippet when logging an activity or leaving a comment on a record using the HubSpot mobile app for Android. There are two ways to add a snippet: Type the # symbol into the text editor. Start typing the snippet shortcut, then select the snippet from the dropdown menu.


1 Answers

You can post a snippet to a Slack channel using the API method files.upload.

In order for this to work you need to:

  • Use the content (not the file) parameter to upload the content of your file.
  • Provide the name of the channel in the channels parameter where the snippet should be posted.
  • The filetype is optional. Slack will determine the type of your file based on the filename or "magic bytes" of the file. e.g. using text as filetype will work.
like image 114
Erik Kalkoken Avatar answered Dec 08 '22 01:12

Erik Kalkoken