快速回复在 Messenger Bot 欢迎消息中有效吗?

Do Quick Replies Work in Messenger Bot Welcome Message?

Facebook Messenger Bot 欢迎消息中的快速回复是否有效?这是在您按下 "Get Started" 按钮后显示的消息。

它可能不受支持,但如果支持,我是不是做错了什么?

这是我正在尝试的:

curl -X POST -H "Content-Type: application/json" -d '{
  "setting_type":"call_to_actions",
  "thread_state":"new_thread",
  "call_to_actions":[
    {
        "message": {
          "attachment": {
            "type": "template",
            "payload": {
              "template_type": "generic",
              "elements": [{
                "title": "Hi dad",
                "subtitle": "Hi mom",
                "item_url": "www.google.com",
                "image_url": "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png",
              }]
            }
          }
        },
        "quick_replies":[
            {
                "content_type":"text",
                "title":"option1",
                "payload":"option1payload"
            },
            {
                "content_type":"text",
                "title":"option2",
                "payload":"option2payload"
            }
        ]
    }
  ]
}' "https://graph.facebook.com/v2.6/13333333337/thread_settings?access_token=THISISMYCOOLTOKEN"

我收到的错误是:

Invalid Keys \"message, quick_replies\" were found in param \"call_to_actions[0]\"."type":"OAuthException","code":100

没有。 payload 仅适用于 string 文本。参见 https://developers.facebook.com/docs/messenger-platform/thread-settings/get-started-button

curl -X POST -H "Content-Type: application/json" -d '{
  "setting_type":"call_to_actions",
  "thread_state":"new_thread",
  "call_to_actions":[
    {
      "payload":"USER_DEFINED_PAYLOAD"
    }
  ]
}' "https://graph.facebook.com/v2.6/me/thread_settings?access_token=PAGE_ACCESS_TOKEN"   
  • call_to_actions限制为1个call_to_actions必须至少包含 一个payload
  • 此数据将通过 webhook 发回给您。