我有一个 png 上传到具有公共读取权限的 S3 存储桶。当我使用信使API发送它时,我收到以下错误:
Messenger Error received. For more information about error codes, see: https://developers.facebook.com/docs/messenger-platform/reference/send-api/error-codes
{ message: '(#100) Failed to fetch the file from the url',
type: 'OAuthException',
code: 100,
error_subcode: 2018008,
fbtrace_id: 'F8w/11MzB9B' }
我的 S3 网址采用 https://bucketname.s3.amazonaws.com/filename.png 格式,当我访问它时,它可以工作,但会导致自动下载。信使是否期望显示图像?如果是这样,我如何更改 S3 设置以允许这样做。
谢谢大家!
问题是 Messenger 不接受 png 文件类型,尽管我在文档:(中看到发送 png 的示例。
发送 jpeg 反而有效。
确保上传 S3 对象时指定了Content-Type
,并且具有公共读取权限(或预签名 URL),这一点很重要。
编辑:有效,但不适用于预签名请求