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

Download file using WebClient #1434

Open
1 of 9 tasks
freud14-tm opened this issue Nov 28, 2023 · 1 comment
Open
1 of 9 tasks

Download file using WebClient #1434

freud14-tm opened this issue Nov 28, 2023 · 1 comment
Labels
discussion M-T: An issue where more input is needed to reach a decision enhancement M-T: A feature request for new functionality Version: 3x web-client
Milestone

Comments

@freud14-tm
Copy link

Right now, the only way to download a file from Slack is to do something like this:

import requests
response = requests.get(url_private, headers={"Authorization": f"Bearer {TOKEN}"}, timeout=30)

However, this does not respects the parameters passed to WebClient. We should be able to do something like:

client = WebClient()
response = client.get(url_private)

Or something along those lines.

Category (place an x in each of the [ ])

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.models (UI component builders)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.rtm (RTM client)
  • slack_sdk.signature (Request Signature Verifier)

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

@seratch seratch added discussion M-T: An issue where more input is needed to reach a decision web-client Version: 3x and removed untriaged labels Nov 28, 2023
@seratch
Copy link
Member

seratch commented Nov 28, 2023

Hi @freud14-tm, thanks for taking the time to share the feedback.

Since the WebClient class is supposed to be used only for https://api.slack.com/methods endpoints, we don't have immediate plans to add something like you suggested. With that being said, adding a useful module for downloading files could be beneficial for many developers. Thus, we may add such in the future. For now, please go ahead with requests library for it.

@seratch seratch added this to the 3.x milestone Nov 28, 2023
@seratch seratch added the enhancement M-T: A feature request for new functionality label Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion M-T: An issue where more input is needed to reach a decision enhancement M-T: A feature request for new functionality Version: 3x web-client
Projects
None yet
Development

No branches or pull requests

2 participants