Reputation: 2527
I have an outgoing webhook that listens to my public channel. When I post an image on the channel, I get a url for that image. However this url cannot be shared publicly since people need to be authenticated to view the message.
Is there any way I can generate a public link using the Slack API or is there no way around doing this manually?
Upvotes: 4
Views: 1352
Reputation: 32757
Yes, that should be possible with the API.
Here is what you need to do to get the public url for an image that was uploaded to a channel by a user:
Get the id of the posted image file with files.list
using the user_id and timestamp you received through the outgoing webhook from Slack
Call files.sharedPublicURL
to make the file public and receive a public url
Upvotes: 1