返回開發人員最新消息

開發人員社群的 Messenger 秘密回覆更新資訊

2023年10月3日發佈者:Rahul Raina、Elaine Wang 和 Ashish Khapre

秘密回覆可讓企業的 Facebook 專頁向曾發佈帖子、回應帖子或回應專頁的用戶傳送單則訊息。

支援群組秘密回覆

在 9 月,我們將這項功能的支援範圍延伸至 Facebook 群組,讓企業能夠在 Facebook 群組內向曾回應其專頁帖子的用戶傳送秘密回覆。

運作方式

如要向某則帖子或回應傳送秘密回覆,請向 /PAGE-ID/messages 端點傳送 POST 要求,並將要求中的 recipient 參數設定為 post_idcomment_id,而 message 參數則包含您想傳送的訊息內容。

以下範例展示了顧客在發佈於您專頁的帖子所發表的回應:

你好,我想為我的外甥買一份禮物。你有什麼推薦嗎?

  curl -X POST -H "Content-Type: application/json" -d '{
    "recipient": {
        "post_id": "PAGE-POST-ID"
    },
    
    "message": {
      "attachment":{
        "type":"template",
        "payload":{
          "template_type":"button",
          "text":"Of course, what is your budget for the gift?",
          "buttons":[
              {
                  "type": "postback",
                  "title": "LESS THAN $20",
                  "payload": "GIFT_BUDGET_20_PAYLOAD"
              },
              {
                  "type": "postback",
                  "title": "$20 TO $50",
                  "payload": "GIFT_BUDGET_20_TO_50_PAYLOAD"
              },
              {
                  "type": "postback",
                  "title": "MORE THAN $50",
                  "payload": "GIFT_BUDGET_50_PAYLOAD"
              }
          ]
        }
      }
    }
}' "https://graph.facebook.com/<GRAPH-API-VERSION>/PAGE-ID/messages?access_token=<PAGE-ACCESS-TOKEN>"

回應所觸發的秘密回覆流程。

如需更多資訊,請參閱下方文件: