2016-07-06 72 views
0

快速回复在Facebook Messenger Bot欢迎辞中有效吗?这是您按下“开始使用”按钮后显示的消息。快速回复在Messenger Bot欢迎信息中工作吗?

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

这里就是我想:

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 
+0

将它们作为单独的消息一个接一个发送?应该解决你的问题。 – AndreasB

回答

0

都能跟得上。​​仅适用于字符串文本。见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必须包含至少 一个​​串
  • 该数据将通过webhook发回给您。