Nagarjuna Reddy
Nagarjuna Reddy

Reputation: 4195

Slack API upload image or video

I am learning slack API to create a bot using howdy botkit. I am trying to implement upload image/video functionality using upload button. I don't have any idea how to implement. I have gone through few articles but doesn't works for me. Help me.

Upvotes: 1

Views: 553

Answers (1)

Erik Kalkoken
Erik Kalkoken

Reputation: 32827

I am not very familiar with the mentioned botkit, but in general you can upload images to Slack using the Slack API method files.upload method. This call will return a file ID, which you can then use for other file-related API methods. This works great with images (e.g. gif), I have not tried this with video though.

Looking at the howdy botkit documentation and main code it does support all common Slack API methods including file.upload. The syntax should be something like this:

bot.api.files.upload({},function(err,response) {
  //Do something...
})

Upvotes: 1

Related Questions