Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

67
Views
Slack bot send an image by Amazon S3

I'm building a slackbot which takes images from the Amazon S3 bucket and posts it to a slack channel. I made sure that the Amazon S3 bucket is public. Here's my code :


 const slackToken = SLACK_TOKEN;
 const url = 'https://slack.com/api/chat.postMessage';
 const res =  await axios.post(url, {
   channel: '#general',
   blocks: [
   
     {
       type: 'image',
       image_url: AWS_S3_BUCKET_URL,
       alt_text: 'qrcode'
     }
     
   ],
   username: 'SlackBot',
 }, { headers: { authorization: `Bearer ${slackToken}` } });

 console.log('Done', res.data);

But it gives me this wierd error

  ok: false,
  error: 'invalid_blocks',
  errors: [ 'downloading image failed [json-pointer:/blocks/0/image_url]' ],
  response_metadata: {
    messages: [
      '[ERROR] downloading image failed [json-pointer:/blocks/0/image_url]'
    ]
  }
}

When I replace the AWS_S3BUCKET_URL with any other url like https://mms.businesswire.com/media/20200513005022/en/791013/22/AWS_logo_RGB.jpg It works fine, But gives error in case of AWS_S3_BUCKET_URL.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!