title: Facebook Messenger bot Generic Template Not Working
body: <p>I have created a Facebook Messenger bot which works fine. I have used the <a href="https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template" rel="nofollow noreferrer">Button Template</a> and Image template, and both work perfectly. But when I try the Generic Template, I get no response. I have simply copy pasted the code from <a href="https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template" rel="nofollow noreferrer">here</a>, by performing the appropriate modifications. </p>
  
  <p>I don't know how to debug. Facebook Messenger gives no output on the messaging box. I am currently running the app via Heroku.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>def send_message(token, recipient):
      r = requests.post("https://graph.facebook.com/v2.6/me/messages",
       params={"access_token": token},
       data=json.dumps({
        "recipient":{
          "id":recipient
        },
        "message":{
          "attachment":{
            "type":"template",
            "payload":{
              "template_type":"generic",
              "elements":[
                 {
                  "title":"Welcome to Peter\'s Hats",
                  "image_url":"http://www.godominion.com/content/images/feature-img-small-appliance-electronics.png",
                  "subtitle":"We\'ve got the right hat for everyone.",
                  "default_action": {
                    "type": "web_url",
                    "url": "https://peterssendreceiveapp.ngrok.io/view?item=103",
                    "messenger_extensions": true,
                    "webview_height_ratio": "tall",
                    "fallback_url": "https://peterssendreceiveapp.ngrok.io/"
                  },
                  "buttons":[
                    {
                      "type":"web_url",
                      "url":"https://petersfancybrownhats.com",
                      "title":"View Website"
                    }           
                  ]      
                }
              ]
            }
          }
        }
      }),
       headers={'Content-type': 'application/json'})
      if r.status_code != requests.codes.ok:
        print r.text 
  </code></pre>
  
  <p>I would appreciate any help.</p>
  
  <p>Thank you.</p>
  
  <p><strong>EDIT 1: SOLUTION</strong></p>
  
  <p>I got rid of the issue by commenting out:</p>
  
  <p><code>"messenger_extensions": true,</code></p>
  
  <p>and</p>
  
  <p><code>"fallback_url": "https://peterssendreceiveapp.ngrok.io/"},</code></p>
  
  <p>I'm sure this is not the correct method. But as I am creating a bot, without actual links, this works.</p>