M O N I T R I
M I R A I

Loading ...


img

Add Contact To Your Hubspot

Push Your Contacts Using REST API'S

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.

There are a few ways you can add contacts into HubSpot:

  • Manually create an individual contact.
  • Import a list of contacts.
  • Import using another integration.
  • Using REST API'S.

#Adding Contact's To Your Hubspot Using API'S

  • Login into Hubspot Dashboard.
  • Now click on integration's on top-right nav bar as shown below.
  • Now go to Hubspot API key section and click on create new key.
  • Now copy and store the API Key (which is used in further to call API).
  • Now replace the YOUR-HubSpot-KEY in the below code.

  • $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; }

  • Now save the code in php file on your server and run it.
  • You will see JSON response of contact created.
  • You can check in contact section in Hubspot dashboard.

#3. Integration of source code

  • Go to AWS IAM Users.
  • Copy and paste the below code on your webpage.
  •                                                 
                                                    
  • Now replace the key-id in the above code and save the file with .html

img
img

Stay Connected With
Cutting Edge IT