-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undocumented changes to file object #2040
Comments
Silly question: was the file shared to any channel or group during upload? By default, if sharing options are not specified, then the file remains 'private', that is, accessible only by the user or app that uploaded it. If this is the case, I would expect the Also, some fields like The
|
Thanks for the quick reply. In both cases (using |
It seems like you are providing a What token is being used for the upload API call? A user token? A bot token? I'm trying to understand the baseline permissions to this file based on which token is used to upload it. Is the bot uploading the file as itself, or is your app using a user token and uploading the file on behalf of a user? |
A bot token. I can also give a reproducible example that uploads to a public or private channel if that would be helpful. I guess my main point is that response has changed between |
Not sure I follow what you mean by 'response has changed.' If I understand correctly, you previously used the A reproduction sample is always helpful! Much easier to discuss with specifics in hand rather than in abstract. |
Hmm. Possibly a misunderstanding on my part. Based on posts like this one I had the impression that the new upload steps:
were intended to be a replacement for the old I do see that the |
I agree. We could probably spend some time validating the response types and making this clearer in our documentation. I'll leave this issue open as an enhancement to tackle. |
Thank you for you help! I have now tried manually polling First call to {
"ok": true,
"file": {
"id": "F07P25P8BMZ",
"created": 1727292892,
"timestamp": 1727292892,
"name": "Screen Shot 2024-08-05 at 11.26.42 AM.png",
"title": "Screen Shot 2024-08-05 at 11.26.42 AM.png",
"mimetype": "",
"filetype": "",
"pretty_type": "",
"user": "U04JUMFCGE6",
"user_team": "TU7B08JCV",
"editable": false,
"size": 125862,
"mode": "hosted",
"is_external": false,
"external_type": "",
"is_public": false,
"public_url_shared": false,
"display_as_bot": false,
"username": "",
"url_private": "https://files.slack.com/files-pri/TU7B08JCV-F07P25P8BMZ/screen_shot_2024-08-05_at_11.26.42_am.png",
"url_private_download": "https://files.slack.com/files-pri/TU7B08JCV-F07P25P8BMZ/download/screen_shot_2024-08-05_at_11.26.42_am.png",
"media_display_type": "unknown",
"permalink": "https://wranglesoft.slack.com/files/U04JUMFCGE6/F07P25P8BMZ/screen_shot_2024-08-05_at_11.26.42_am.png",
"permalink_public": "https://slack-files.com/TU7B08JCV-F07P25P8BMZ-a66148e629",
"favorites": [],
"is_starred": false,
"shares": {},
"channels": [],
"groups": [],
"ims": [],
"has_more_shares": false,
"has_rich_preview": false,
"file_access": "visible",
"comments_count": 0
},
"comments": [],
"response_metadata": {
"next_cursor": "",
"scopes": [
"chat:write",
"chat:write.public",
"commands",
"im:history",
"users:read",
"users.profile:read",
"workflow.steps:execute",
"channels:history",
"channels:join",
"usergroups:read",
"channels:read",
"groups:history",
"groups:read",
"chat:write.customize",
"im:read",
"groups:write",
"reactions:read",
"team:read",
"reactions:write",
"files:write",
"files:read"
],
"acceptedScopes": [
"files:read"
]
}
} Second call to {
"ok": true,
"file": {
"id": "F07P25P8BMZ",
"created": 1727292892,
"timestamp": 1727292892,
"name": "Screen Shot 2024-08-05 at 11.26.42 AM.png",
"title": "Screen Shot 2024-08-05 at 11.26.42 AM.png",
"mimetype": "image/png",
"filetype": "png",
"pretty_type": "PNG",
"user": "U04JUMFCGE6",
"user_team": "TU7B08JCV",
"editable": false,
"size": 125862,
"mode": "hosted",
"is_external": false,
"external_type": "",
"is_public": false,
"public_url_shared": false,
"display_as_bot": false,
"username": "",
"url_private": "https://files.slack.com/files-pri/TU7B08JCV-F07P25P8BMZ/screen_shot_2024-08-05_at_11.26.42_am.png",
"url_private_download": "https://files.slack.com/files-pri/TU7B08JCV-F07P25P8BMZ/download/screen_shot_2024-08-05_at_11.26.42_am.png",
"media_display_type": "unknown",
"thumb_64": "https://files.slack.com/files-tmb/TU7B08JCV-F07P25P8BMZ-16f89dab26/screen_shot_2024-08-05_at_11.26.42_am_64.png",
"thumb_80": "https://files.slack.com/files-tmb/TU7B08JCV-F07P25P8BMZ-16f89dab26/screen_shot_2024-08-05_at_11.26.42_am_80.png",
"thumb_360": "https://files.slack.com/files-tmb/TU7B08JCV-F07P25P8BMZ-16f89dab26/screen_shot_2024-08-05_at_11.26.42_am_360.png",
"thumb_360_w": 360,
"thumb_360_h": 105,
"thumb_480": "https://files.slack.com/files-tmb/TU7B08JCV-F07P25P8BMZ-16f89dab26/screen_shot_2024-08-05_at_11.26.42_am_480.png",
"thumb_480_w": 480,
"thumb_480_h": 140,
"thumb_160": "https://files.slack.com/files-tmb/TU7B08JCV-F07P25P8BMZ-16f89dab26/screen_shot_2024-08-05_at_11.26.42_am_160.png",
"thumb_720": "https://files.slack.com/files-tmb/TU7B08JCV-F07P25P8BMZ-16f89dab26/screen_shot_2024-08-05_at_11.26.42_am_720.png",
"thumb_720_w": 720,
"thumb_720_h": 211,
"thumb_800": "https://files.slack.com/files-tmb/TU7B08JCV-F07P25P8BMZ-16f89dab26/screen_shot_2024-08-05_at_11.26.42_am_800.png",
"thumb_800_w": 800,
"thumb_800_h": 234,
"original_w": 848,
"original_h": 248,
"thumb_tiny": "AwAOADC8zFQvzKv1ppkP9+OnkEqMNj8M0mx/74/75oATec43pSeYeu5MfjT9r/3x/wB80m1/74/75oAVSxIOVK+op460za/9/wDSnKCOpz+FAH//2Q==",
"permalink": "https://wranglesoft.slack.com/files/U04JUMFCGE6/F07P25P8BMZ/screen_shot_2024-08-05_at_11.26.42_am.png",
"permalink_public": "https://slack-files.com/TU7B08JCV-F07P25P8BMZ-a66148e629",
"favorites": [],
"is_starred": false,
"shares": {},
"channels": [],
"groups": [],
"ims": [],
"has_more_shares": false,
"has_rich_preview": false,
"file_access": "visible",
"comments_count": 0
},
"comments": [],
"response_metadata": {
"next_cursor": "",
"scopes": [
"chat:write",
"chat:write.public",
"commands",
"im:history",
"users:read",
"users.profile:read",
"workflow.steps:execute",
"channels:history",
"channels:join",
"usergroups:read",
"channels:read",
"groups:history",
"groups:read",
"chat:write.customize",
"im:read",
"groups:write",
"reactions:read",
"team:read",
"reactions:write",
"files:write",
"files:read"
],
"acceptedScopes": [
"files:read"
]
}
} |
What about listening on various |
Thank you, I will give that a try. Even does work it would be a much more a significant change to the way our application handles file uploads. Given that this article suggesting polling |
Fair! I will throw that recommendation the Files' team's way, but I also suggest you submit that as a feature request / API extension via the [email protected] email; generally speaking, Slack leadership takes customer reports more seriously with respect to prioritizing work than my suggestions 😅 |
Packages:
Select all that apply:
@slack/web-api
@slack/rtm-api
@slack/webhooks
@slack/oauth
@slack/socket-mode
@slack/types
Reproducible in:
The Slack SDK version
Node.js runtime version
v18.11.0
OS info
ProductName: macOS
ProductVersion: 12.5
BuildVersion: 21G72
Darwin Kernel Version 21.6.0: Sat Jun 18 17:07:22 PDT 2022; root:xnu-8020.140.41~1/RELEASE_ARM64_T6000
Steps to reproduce:
Expected result:
An example of a file object returned by the to-be-deprecated
files.upload
method. This matches the object shown here in the docs: https://api.slack.com/types/fileActual result:
This is an example of a file object returned by the new, recommended
files.uploadV2
method. You can see that many fields are either missing or empty when compared to the file type shown in the api docs. Most notably, for our purposes, aremimetype
,shares
,channels
, andgroups
. The new, reduced file object is consistent between the initial return fromfiles.uploadV2
and subsequent calls tofiles.info
after a successful upload.Requirements
For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
The text was updated successfully, but these errors were encountered: