- 20 Feb, 2024
Loading ...
Your HubSpot contacts database draws details from every touchpoint between your leads and your brand and organizes them all for you in one place. Your contacts database is the heart of your marketing and sales efforts. This article walks through adding your existing contacts into HubSpot so you can begin nurturing your leads further down the inbound funnel.
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hubapi.com/contacts/v1/contact?hapikey=YOUR-HubSpot-KEY",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\r\n \"properties\": [\r\n
{\r\n \"property\": \"email\",\r\n \"value\": \"[email protected]\"\r\n
},\r\n {\r\n \"property\": \"firstname\",\r\n \"value\": \"Techhawa\"\r\n
},\r\n {\r\n \"property\": \"lastname\",\r\n \"value\": \".com\"\r\n
},\r\n {\r\n \"property\": \"website\",\r\n \"value\": \"https://www.techhawa.com\"\r\n
},\r\n {\r\n \"property\": \"company\",\r\n \"value\": \"Techhawa\"\r\n },\r\n
{\r\n \"property\": \"phone\",\r\n \"value\": \"555-122-2323\"\r\n },\r\n {\r\n
\"property\": \"address\",\r\n \"value\": \"25 First Street\"\r\n },\r\n {\r\n
\"property\": \"city\",\r\n \"value\": \"Cambridge\"\r\n },\r\n {\r\n
\"property\": \"state\",\r\n \"value\": \"MA\"\r\n },\r\n {\r\n
\"property\": \"zip\",\r\n \"value\": \"02139\"\r\n }\r\n ]\r\n}",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: application/json",
"postman-token: c6f0a7d5-31be-fbfa-9776-a79423e85df4"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}