// 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]); ?>