2017-06-26 135 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张贴在的问题。