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.

  • hubspot-instegrations-option
  • Now go to Hubspot API key section and click on create new key.

  • hubspot_api_key_create
  • Now copy and store the API Key (which is used in further to call API).

  • hubspot-api-key-copy
  • Now replace the YOUR-HubSpot-KEY in the below code.

  • <?php
    $curl = curl_init();
    curl_setopt_array($curl, array(
      CURLOPT_URL => "",
      CURLOPT_TIMEOUT => 30,
      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\": \"\"\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);
    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.

  • hubspot-add-contact-result

#3. Integration of source code

  • Go to AWS IAM Users.
  • Copy and paste the below code on your webpage.

  • <meta name="viewport" content="width=device-width">
    <form action="/purchase" method="POST">
    <!-- Note that the amount is in paise = 50 INR -->
        data-buttontext="Pay with TechHawa"
        data-name="Merchant Name"
        data-description="Purchase Description"
        data-image="""TechHawa""[email protected]"
    <input type="hidden" value="Hidden Element" name="hidden">
  • Now replace the key-id in the above code and save the file with .html.
  • Note: For live change the mode in top nav bar and copy the LIVE KEY-ID .

  • You can see the demo below.

  • Live Demo