files.sharedPublicURL
method
We're still building and not all features are available quite yet. Enjoy this peek into the future!
Not ready for the future? Return to the past at api.slack.com.
Usage info
This method enables public/external sharing for a file.
Response
The response contains a file object, including the permalink_public
url.
{
"ok": true,
"file": {
"id" : "F2147483862",
"timestamp" : 1356032811,
"name" : "file.htm",
"title" : "My HTML file",
"mimetype" : "text\/plain",
"filetype" : "text",
"pretty_type": "Text",
"user" : "U2147483697",
"mode" : "hosted",
"editable" : true,
"is_external": false,
"external_type": "",
"size" : 12345,
"url_private": "https:\/\/slack.com\/files-pri\/T024BE7LD-F024BERPE\/1.png",
"url_private_download": "https:\/\/slack.com\/files-pri\/T024BE7LD-F024BERPE\/download\/1.png",
"thumb_64": "https:\/\/slack-files.com\/files-tmb\/T024BE7LD-F024BERPE-c66246\/1_64.png",
"thumb_80": "https:\/\/slack-files.com\/files-tmb\/T024BE7LD-F024BERPE-c66246\/1_80.png",
"thumb_360": "https:\/\/slack-files.com\/files-tmb\/T024BE7LD-F024BERPE-c66246\/1_360.png",
"thumb_360_gif": "https:\/\/slack-files.com\/files-tmb\/T024BE7LD-F024BERPE-c66246\/1_360.gif",
"thumb_360_w": 100,
"thumb_360_h": 100,
"permalink": "https:\/\/coolkids.slack.com\/files\/cal\/F024BERPE\/1.png",
"permalink_public": "https:\/\/slack-files.com\/T024BE7LD-F024BERPE-8004f909b1",
"edit_link": "https:\/\/coolkids.slack.com\/files\/cal\/F024BERPE\/1.png/edit",
"preview": "<!DOCTYPE html>\n<html>\n<meta charset='utf-8'>",
"preview_highlight": "<div class=\"sssh-code\"><div class=\"sssh-line\"><pre><!DOCTYPE html...",
"lines" : 123,
"lines_more": 118,
"is_public": true,
"public_url_shared": false,
"channels": ["C024BE7LT", ...],
"groups": ["G12345", ...],
"initial_comment": {...},
"num_stars": 7,
"is_starred": true
},
"comments": [
{
"id": "Fc027BN9L9",
"timestamp": 1356032811,
"user": "U2147483697",
"comment": "This is a comment"
},
...
],
"paging": {
"count": 100,
"total": 2,
"page": 1,
"pages": 0
}
}
The file object contains information about the uploaded file.
Only the original creator of the file can use the files.sharedPublicURL
method unless the file is shared into a public channel.
Each comment object in the comments array contains details about a single comment. Comments are returned oldest first.
The paging information contains the count
of comments returned, the total
number of
comments, the page
of results returned in this response and the total number of pages
available. Please note that the max count
value is 1000
and the max page
value is 100
.