[Python] How to use the permalink_public URL of an uploaded image to include it in a message?

Discussão em 'Python' iniciado por Stack, Setembro 24, 2024.

  1. Stack

    Stack Membro Participativo

    I am trying to upload an image to slack and post it in an image block of a slack message to a specific channel.

    1. upload an image to Slack.
    2. make the image public with files.sharedPublicURL
    3. check if the url is public: public_url_shared being true.
    4. use the permalink_public I receive for the uploaded image for creating the slack message (an image block).

    for debugging I am using Slack's Block Kit Builde. I am replacing the URL in the image_url example of the block kit demo with the one I received from slack:

    https://slack-files.com/T04AG7BVD-FLWHBHY86-1ba8263c00


    or:

    https://slack-files.com/T04AG7BVD-FLNJJURL1-7b17f26c80


    The image should be shown. Instead there is the error in Slack's Block Kit Builder as well as a direct slack-api call: Downloading image failed.

    If I open the permalink_public in an incognito session. I can see the file. so it is public.

    Continue reading...

Compartilhe esta Página