Hi connor … thanks for the reply, I am able to test with account and dev account and getting access_token
$hubEventUrl. = “https://api.hubapi.com/integrations/v1/<<>>/timeline/event?hapikey=”<<>&userId=<<>>";
$re = $_SESSION["result"];
// here portalId= non dev account id
//eventTypeId = already created in dev account with 2 properties, emailid, sessionid
//email[support@xxxxx.com] = already present in non dev account as contact
$json = '{"id": "'.$_SESSION["portalId"].'", "eventTypeId":"380358","email":"support@xxxxx.com"}';
// I havent got Bearer token so I am using access_token below
$headers = array();
$headers[] = "Content-Type: application/json";
$headers[] = "Authorization: Bearer ".$re["access_token"];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $hubEventUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS,$json);
curl_setopt($ch, CURLOPT_POST, 3);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$xjson = curl_exec($ch);
On execution if this I am not getting any response and not even Timeline is created for contact “support@xxxxx.com”.
Not sure what is I am missing here.
You can test code here →
https://290px.com/app/oauth.php, provide any hubid…