2017-06-26 155 views
0

這是下面的完整JSON,我使用Facebook的通用模板發送。Facebook Messenger API - 400錯誤的請求?

我檢查它行由行與這裏的官方文檔 - >https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template

但我得到了以下一個400錯誤請求錯誤。我錯過了什麼?

{ 
    "recipient":{ 
     "id":"1347939335300515" 
    }, 
    "message":{ 
     "attachment":{ 
     "type":"template", 
     "payload":{ 
      "template_type":"generic", 
      "elements":[ 
       { 
        "title":"Welcome to Peters Hats", 
        "image_url":"https://cdn.pixabay.com/photo/2013/07/13/10/41/hat-157581_960_720.png", 
        "subtitle":"Weve got the right hat for everyone.", 
        "default_action":{ 
        "type":"web_url", 
        "url":"https://cdn.pixabay.com/photo/2013/07/13/10/41/hat-157581_960_720.png", 
        "messenger_extensions":true, 
        "webview_height_ratio":"tall", 
        "fallback_url":"https://cdn.pixabay.com/photo/2013/07/13/10/41/hat-157581_960_720.png" 
        }, 
        "buttons":[ 
        { 
         "type":"web_url", 
         "url":"https://cdn.pixabay.com/photo/2013/07/13/10/41/hat-157581_960_720.png", 
         "title":"View Website" 
        }, 
        { 
         "type":"postback", 
         "title":"Start Chatting", 
         "payload":"DEVELOPER_DEFINED_PAYLOAD" 
        } 
        ] 
       } 
      ] 
     } 
     } 
    } 
} 
+0

_「我缺少什麼?」_--這樣的HTTP狀態代碼通常伴隨着包含錯誤消息的響應主體...... – CBroe

回答

0

default_action是一個URL按鈕,不應該是一個回傳按鈕,在JSON張貼在的問題。