2016-10-16 4 views

답변

1

아래 코드는 사용자가 보내거나 클릭 한 모든 것을 얻는 방법을 보여줍니다.

// handle bot's anwser 
$input = json_decode(file_get_contents('php://input'), true); 
$senderId = $input['entry'][0]['messaging'][0]['sender']['id']; 

// gets the text the user sent to you 
$messageText = $input['entry'][0]['messaging'][0]['message']['text']; 

// gets the payload of the button 
$buttonPayLoad = $input['entry'][0]['messaging'][0]['postback']['payload']; 

// gets the payload of the quick replay 
$quickReplyPayLoad = $input['entry'][0]['messaging'][0]['message']['quick_reply']['payload'];