query($sql) === TRUE) { $stat='success'; } else{ $stat='error'; } // Output the result in JSON format header('Content-Type: application/json'); echo json_encode(["status" =>$stat]); } //UPDATE GUEST NAME FROM CHAT ATTEMPT https://autohub.ph/api/bot/newConvo.php?mKey=202510240911&guestName ={{workflow.AI_FName}}&convoID={{event.conversationId}} if($mykey =="202510240911"){ $chatID =$_GET['convoID']; $guestName =$_GET['guestName']; $sql = "UPDATE `bot_chat` SET `guest_name`='$guestName' WHERE `chat_id`='$chatID'"; if ($conn->query($sql) === TRUE) { } if ($conn->query($sql) === TRUE) { $stat='success'; } else{ $stat='error'; } // Output the result in JSON format header('Content-Type: application/json'); echo json_encode(["status" =>$guestName, "chatID"=>$chatID]); } //Update guest Interest if($mykey =="20inquirtyType11"){ $chatID =$_GET['convoID']; $guestInterestBrand =$_GET['guestInterestBrand']; $carBrand =$_GET['carBrand']; $carModel =$_GET['carModel']; $carVariant =$_GET['carType']; $sql = "UPDATE `bot_chat` SET `interest`='$guestInterestBrand',`model`='$carModel' ,`brand`='$carBrand' ,`carType`='$carVariant' WHERE `chat_id`='$chatID'"; if ($conn->query($sql) === TRUE) { } if ($conn->query($sql) === TRUE) { $stat='success'; } else{ $stat='error'; } // Output the result in JSON format header('Content-Type: application/json'); echo json_encode(["status" =>$guestName, "chatID"=>$chatID]); } $conn->close(); ?>