Skip to content

Instantly share code, notes, and snippets.

@Manikkumar1988
Created September 21, 2017 11:56
Show Gist options
  • Save Manikkumar1988/afd769dceb29c41af06a06c2595b0728 to your computer and use it in GitHub Desktop.
Save Manikkumar1988/afd769dceb29c41af06a06c2595b0728 to your computer and use it in GitHub Desktop.
CURL command to upload file on Slack
curl https://slack.com/api/files.upload -F token="${SLACK_TOKEN}" -F channels="${SLACK_CHANNEL}" -F title="${message_title}" -F filename="${filename}" -F file=@"${path_to_file}"
@technical-newfrontierdata

Hi Mate I also need to do the same but I got error like follow
nuwan@nuwan-DevOps:$ curl https://slack.com/api/files.upload -F token="${fmEsYV1LJBiysn}" -F channels="${monitoring}" -F title="${message_title}" -F filename="${filename}" -F file=@"/tmp/myfile.pdf"
{"ok":false,"error":"not_authed"}nuwan@nuwan-DevOps:
$

@sergeyd123
Copy link

Thank you so mush ! Very useful and straight forward.

@Manikkumar1988
Copy link
Author

Thank you so mush ! Very useful and straight forward.

Glad that it helped

@smoneta
Copy link

smoneta commented Mar 18, 2022

awesome, thanks.

@shalva97
Copy link

shalva97 commented Mar 7, 2023

is it possible to use markdown? I want to add formatted links to the message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment