I'm using slack api to upload media to a public channel, in-response I'm getting different urls for the uploaded media including 'permalink_pulic' which seems as the public URL, but that link doesn't work.Other Links are only accessible by slack team members.
Is there any way we can enable those public_link, so that media can be accessible outside slack.
In general Slack files are not public, but you can open public access to them if you want.
Call the method files.sharedPublicURL
after you uploaded it to enable public access to a Slack file via its permalink_public
URL.
See API documentation for more info.
To enable the public link, your app requires the file:write:user permission scope from the team, the team's access_token
and the specific file_id
you're trying to make public
Then send a request to Slack's files.sharedPublicURL(access_token, file_id)
endpoint to receive a JSON object containing the file id.
You can use the new Slack Events API to have Slack send your app file information, including the file id, when events as file_created or file_shared occur. Here's a list of events Slack supports
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With