Skip to content
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

Unable to send image with files_upload_v2() to single user #1426

Closed
natalevichmv opened this issue Nov 15, 2023 · 6 comments
Closed

Unable to send image with files_upload_v2() to single user #1426

natalevichmv opened this issue Nov 15, 2023 · 6 comments
Labels
auto-triage-stale question M-T: User needs support to use the project

Comments

@natalevichmv
Copy link

Can't figure out the way to send image to user using files_upload_v2().

Error: slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://www.slack.com/api/files.completeUploadExternal) The server responded with: {'ok': False, 'error': 'invalid_arguments', 'response_metadata': {'messages': ['[ERROR] input must match regex patt ern: ^[CGDZ][A-Z0-9]{8,}$ [json-pointer:/channel_id]']}}

It seems from the error message that ChannelID must start with C, G, D or Z, whereas my UserID starts with U.

The Slack SDK version

slack-sdk==3.23.0

Python runtime version

Python 3.10.4

OS info

Ubuntu 20.04

@srajiang
Copy link
Member

Hi @natalevichmv! 👋 Thanks for writing in. This error is expected, as the files.completeUploadExternal endpoint expects a channel for the file to be shared in. Similar to how a normal user would experience regular external file sharing in Slack, this must occur in a channel with the intended user.

One way you can do this is supply the channel_id of the DM between your with the user. Or you can share the file in a general channel where both your app user and the target user are members.

@srajiang srajiang added question M-T: User needs support to use the project and removed untriaged labels Nov 15, 2023
Copy link

👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

Copy link

github-actions bot commented Jan 1, 2024

As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.

@github-actions github-actions bot closed this as completed Jan 1, 2024
@arthurvanderwal81
Copy link

Reopening because the 'v1' version of the upload files would allow files to be shared in a private 'chat'. The v2 API breaks this behavior.
We use this endpoint to share files privately to slack users, sending the files to channels does not work for our intended purpose.

@mmarsous
Copy link

mmarsous commented May 9, 2024

FileUploadV2 is breaking V1 in two ways:

  • it does not allow uploading files to multiple channels (V1 allows to use list of channel ids https://api.slack.com/methods/files.upload)
  • it does not allow uploading files to personal channel by member id even if the app is added to that member channel
    These two V1 features are extremely useful and their removal from V2 is stopping us from upgrading so it would be appreciated if they are added to V2.

@sclapper
Copy link

I agree^^ this is an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-triage-stale question M-T: User needs support to use the project
Projects
None yet
Development

No branches or pull requests

5 participants