I am integrating with mailchimp APi using their wrapper class. I have configured the webhook in my mailchimp dashboard and the file which will get webhook response has this on top
if(isset($_POST['type'])){
$yes=$_POST['data']['email'];
$querynewsubscrip="INSERT into newslettersubscrips SET optemail='$yes'";
$resultnewsubscripxx=mysql_query($querynewsubscrip) or die('Query failed: ' . mysql_error());
}
Is this what i need to catch the response from Mailchimp? What i assume is, webhooks send me data through post, type tells me what was the action and data array has all the data. Please guide