ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Send CSV file to Slack Channel by bash script through Webhook

    IT Discussion
    slack csv bash script webhook api
    4
    6
    2.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      Laksh1999
      last edited by scottalanmiller

      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.

      1 1 Reply Last reply Reply Quote 1
      • scottalanmillerS
        scottalanmiller
        last edited by

        Interesting idea. My triage team would probably like to do that, lol.

        But no, I've never attempted that.

        1 Reply Last reply Reply Quote 0
        • 1
          1337 @Laksh1999
          last edited by 1337

          @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.

          L 1 Reply Last reply Reply Quote 0
          • L
            Laksh1999 @1337
            last edited by

            @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 ?

            1 1 Reply Last reply Reply Quote 0
            • 1
              1337 @Laksh1999
              last edited by 1337

              @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?

              stacksofplatesS 1 Reply Last reply Reply Quote 0
              • stacksofplatesS
                stacksofplates @1337
                last edited by

                @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

                1 Reply Last reply Reply Quote 2
                • 1 / 1
                • First post
                  Last post