2016-07-06 6 views
0

Schnelle Antworten funktionieren in Facebook Messenger Bot Begrüßungsnachricht? Dies ist die Nachricht, die nach dem Drücken der Schaltfläche "Erste Schritte" angezeigt wird.Funktionieren schnelle Antworten in Messenger Bot Willkommensnachricht?

Es wird möglicherweise nicht unterstützt, aber wenn es ist, mache ich etwas falsch?

Hier ist, was ich versuche:

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" 

Der Fehler, den ich empfangen habe, ist:

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

Senden Sie sie als separate Nachrichten direkt hintereinander? Sollte dein Problem beheben. – AndreasB

Antwort

0

Nope. payload ist nur für string Text. siehe 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 ist auf 1 call_to_actions muss mindestens eine payload Zeichenfolge enthalten.
  • Diese Daten werden Ihnen per Webhook zugesandt.