title: Facebook messenger bot Get Started Button
body: <p>I'm building my first messenger bot in js and already can receive and reply to messages and send cards with options, but I've already tried everything to setup a get started button but with no success... Here is what I have done for that:</p>
  
  <p>I don't know what i'm doing wrong or where do i have to call the facebookthreadAPI function. Need advice.</p>
  
  <p><strong>Excerpt from index.js:</strong></p>
  
  <pre><code>function facebookThreadAPI(jsonFile, cmd){
  // Start the request
  request({
      url: 'https://graph.facebook.com/v2.6/me/thread_settings?access_token='+process.env.token,
      method: 'POST',
      headers: {'Content-Type': 'application/json'},
      form: require(jsonFile)
  },
  function (error, response, body) {
      if (!error &amp;&amp; response.statusCode == 200) {
          // Print out the response body
          console.log(cmd+": Updated.");
          console.log(body);
      } else { 
          // TODO: Handle errors
          console.log(cmd+": Failed. Need to handle errors.");
          console.log(body);
      }
  });}
  </code></pre>
  
  <p><strong>Excerpt from fb-get-started-button.json:</strong></p>
  
  <pre><code>{
     "setting_type":"call_to_actions",
     "thread_state":"new_thread",
     "call_to_actions":[
        {
          "payload":"action?POSTBACKHERE"
        }
     ]
  }
  </code></pre>