@pete-s said in Send CSV file to Slack Channel by bash script through Webhook:

@laksh1999 said in Send CSV file to Slack Channel by bash script through Webhook:

@pete-s said in Send CSV file to Slack Channel by bash script through Webhook:

@laksh1999 said in Send CSV file to Slack Channel by bash script through Webhook:

Hi
I am trying to send the assigned tickets in the queue as .csv file to the slack channel. I am able to download the .csv file in the dev desktop through bash script but unable to send that file to the Slack Channel.

Anyone have tried this before?

I have checked this

https://api.slack.com/methods/files.upload

I have only Webhook URL no other token is there with me as per the suggestion in the above link.

You must have a token or some kind of authentication, otherwise anyone would be spam slack with files.

Also the function you are looking at is not a webhook. Webhooks are triggered by an event. And they cause a http request to be sent.

I accept with your point the csv file which i download is authenticated with the kerberos only.So is that enough and send the .csv file to the slack channel through the webhook ?

@stacksofplates maybe you can offer some insight?

At the bottom of the upload API page they give you an example of what you need. You need your API token and the channel ID(s) that you want to send the data to.

curl -F [email protected] -F "initial_comment=Shakes the cat" -F channels=C024BE91L,D032AC32T -H "Authorization: Bearer xoxa-xxxxxxxxx-xxxx" https://slack.com/api/files.upload