我将png上传到具有公共读取权限的S3存储桶。当我使用Messenger 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,当我访问它时,它可以正常工作,但会导致自动下载。 Messenger是否期望显示图像?如果是这样,我如何更改S3设置以允许此操作。
全部谢谢!
答案 0 :(得分:0)
问题是Messenger不接受png文件类型,尽管我在文档中看到了png的示例:(。
发送jpeg代替工作。
确保上传的S3对象具有Content-Type
指定的公共读取权限(或预先签名的URL)非常重要。
编辑:有效,但不适用于预先签名的请求