Webhook failed: Server error Server responded with error code 500

contacts

#1

Getting “Webhook failed: Server error Server responded with error code 500”

This hook works with the DEV API key just fine. Once I added the Production key this issue started.

Code used:

// Create array for JSON conversion
$post_hub = array(
‘properties’ => array(
array(‘property’ => ‘age’,‘value’ => $age ),
array(‘property’ => ‘address’,‘value’ => $streetLine1 . $streetLine2 ),
array(‘property’ => ‘city’,‘value’ => $city ),
array(‘property’ => ‘state’,‘value’ => $state ),
array(‘property’ => ‘zip’,‘value’ => $postalCode )
));

$data_string = json_encode($post_hub);

$ch = curl_init();
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_URL, “https://api.hubapi.com/contacts/v1/contact/vid/$vid/profile?hapikey=$WeAPI”);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(“Content-Type: application/json”));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

//execute post
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE); //gets back the code for failure or success