How do I send an image hosted on Amazon S3 via the Facebook Messenger send API?

The messaging API returns a response to me (# 546) The type of file you are trying to attach is not allowed. Please try again in a different format. error code: 546, error_subcode: 154502

However, if I post the exact exact image on Google Cloud instead of Amazon S3, then the image sends a fine.

My link to the AWS image: https://s3.amazonaws.com/paloma-staging-public/files/conversation-step-56-80925.gif

My Google Cloud Image link is: https://storage.googleapis.com/callparty/thumbsup.gif

Are there any special reasons why a link to an image stored on S3 will not work as an image attachment, but will there be a link to an image stored in the Google Cloud?

+4
source share
1 answer

The answer was that no file was installed for the AWS ContentType link.

When uploading to S3, I had to manually set the ContentType of the file accordingly ("image / gif", "image / png", etc.), and for Google Cloud Storage this should be automatically installed.

This is why the S3 link causes it to load automatically, and the Google Cloud link displays an image in the browser.

+4
source

Source: https://habr.com/ru/post/1686359/


All Articles