title: sending button using facebook messenger in php
body: <p>I'm trying to send a button attachment using facebook messenger bot.</p>
  
  <p>I trided it using  javascript  and it works fine, but php it does not.</p>
  
  <p>This is what I have tried so far.</p>
  
  <pre><code>     $button1= array("type"=&gt;"postback","title"=&gt;"Click Button","payload"=&gt;"something:") ;
       $buttons= array($button1);
       $payload=array("template_type"=&gt;"button","text"=&gt;"Something","buttons"=&gt;$buttons);
  
       $attachment=array("type"=&gt;"template","payload"=&gt;$payload);
  
       $messageData= array("recipient"=&gt;"xxxxxxxxxx",
                           "message"=&gt;array("attachment"=&gt;$attachment));
  
  
       $data= json_encode($messageData);
       callSendAPI($data);
  </code></pre>
  
  <p>error message is</p>
  
  <pre><code>          {"error":{"message":"(#100) param recipient must be non-empty.","type":"OAuthException","code":100,"fbtrace_id":"DZN+n5S7uuR"}}
  </code></pre>
  
  <p>Nothing wrong with  callSendAPI() function , because it works with text, image messages.</p>
  
  <p>What am I doing wrong here???</p>
  
  <p>Thanks</p>