为什么我在Facebook Messenger Webhook请求中没有收到附件? [英] Why I do not receive the attachments in the Facebook Messenger webhook request?

查看:114
本文介绍了为什么我在Facebook Messenger Webhook请求中没有收到附件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自昨天(2020年10月29日)以来,我仅在链接到我的应用程序的页面之一上遇到此问题,其他页面则正常工作:

Since yesterday (29/10/2020) i'm having this problem only on one of the pages linked to my app, the others work correctly:

webhook 从Facebook收到的附件消息不包含附件字段.仅带有贴纸的邮件包含附件".场地.所有其他(图像,视频,音频等)编号

The attached messages that the webhook receives from Facebook do not contain the attachment field. Only messages with stickers contain the "attachment" field. All others (image, video, audio etc.) No.

我期望(作为facebook文档)是:

What I expect (as facebook documentation) is:

{
  "id": "682498302938465",
  "time": 1518479195594,
  "messaging": [
    {
      "sender": {
        "id": "<PSID>"
      },
      "recipient": {
        "id": "<PAGE_ID>"
      },
      "timestamp": 1518479195308,
      "message": {
        "mid": "mid.$cAAJdkrCd2ORnva8ErFhjGm0X_Q_c",
        "attachments": [
          {
            "type": "<image|video|audio|file>",
            "payload": {
              "url": "<ATTACHMENT_URL>"
            }
          }
        ]
      }
    }
  ]
}

但我只收到:

{
    "object": "page",
    "entry": [
        {
            "id": "119320008135788",
            "time": 1604051633128,
            "messaging": [
                {
                    "sender": {
                        "id": "XXXXXX"
                    },
                    "recipient": {
                        "id": "XXXXXX"
                    },
                    "timestamp": 1604051632953,
                    "message": {
                        "mid": "m_7DRP...."
                    }
                }
            ]
        }
    ]
}

此操作仅发生在2020年10月29日的一页上

有人有同样的问题/知道为什么会发生吗?

Does anyone have the same problem / know why it happens?

推荐答案

Facebook支持团队确认我的问题,并且正在调查中.

The Facebook support team has confirmed my problem, and is investigating.

我现在正在解决使用图形API通过 mid

I am now solving using the graph api to get the desired message information using the mid

GET /v8.0/{message-id} HTTP/1.1
Host: graph.facebook.com

https://developers.facebook.com/docs/graph-api/reference/v8.0/message

例如.


GET 

https://graph.facebook.com/v8.0/' + mid + '?fields=message%2Cfrom%2Csticker%2Ctags%2Cid%2Cattachments.limit(10)%7Bid%2Cimage_data%2Cmime_type%2Cname%2Cfile_url%2Cvideo_data%7D&access_token=XXXXXX

这篇关于为什么我在Facebook Messenger Webhook请求中没有收到附件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆