JSON API REQUEST PARAMETERS

Following are the parameter which will be sent to JSON API.

πŸ‘‰{user_id}
πŸ‘‰{first_name}
πŸ‘‰{last_name}
πŸ‘‰{gender}
πŸ‘‰{timezone}
πŸ‘‰{fbId}
πŸ‘‰{last_user_msg}
πŸ‘‰{bot_id}

You can access these parameters based on your Request Method i.e, GET or POST. Example Code(PHP):
// GET REQUEST

<?php
   $user_id = $_GET[β€˜{user_id}’];
?>
// POST REQUEST

<?php
   $json = file_get_contents('php://input');
   $json = json_decode($json,true);
   $first_name = $json['{first_name}'];
   $message = "Hi, ".$first_name.". How are you?";
   echo json_encode(['text'=>$message]);
?>
DataStore/User Attributes Values: If you have used DataStore or User Attributes in your story, For example, you have created an DataStore of β€œcolor” and user says β€œI like red color”. The Parameter Key will be β€œcolor” and the value will be in array form:
<?php
   $json = file_get_contents('php://input');
   $json = json_decode($json,true);
   $color= $json['{color}'];
   $message = $color." is a beautiful color.";
   echo json_encode(['text'=>$message]);
?>