slackapi / slackapi/python-slack-sdk

block/type/image should allow image_url to reference an uploaded file to Slack without having to make it public

Open
#1,444 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

server-side-issue Version: 3x web-client
Dominant language
Python
Stars
4k
Forks
857
Avg merge
22h 21m
Merged PRs (30d)
16

Description

(Describe your issue and goal here)

This should work:

  1. upload an image with client.files_upload_v2(), do not want it to be visible in a channel
  2. chat_postMessage(blocks=type: image, image_url: file.private_url ...)

This currently doesn't work unless the file/image is made public via client.files_sharedPublicURL(), but enabling public files is not an option in many organisations. Additionally one shouldn't have to construct urls by extracting pub_secret from file/permalink_public.

Given that slack client can show uploaded images (even when they are not public), it should also work with blocks/type/image.

Example discussion/solution (with making the file public) - https://stackoverflow.com/questions/58186399/how-to-create-a-slack-message-containing-an-uploaded-image

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at slack_sdk.models, focusing on the image block builder and how its image_url value is represented. Verify the behavior with a privately uploaded Slack file, and consider the work complete when the block can reference that file without making it public or manually extracting a public URL.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.