HubSpot API
https://www.zyxware.com/sites/default/files/styles/user_image/public/default_images/index.png?itok=2YmREnrP
BY fathimath.sajila
3 years ago
API-Integration
0
comments comment

The API is allow you to create a functional application or integration quickly and easily. JSON will be returned in all responses from the API, including errors. The API needs two types of authentication, one is OAuth and the other is API keys.

We can test API using HubSpot demo portal by signing in using the below credentials.

Login: https://login.hubspot.com/login/?loginPortalId=62515
Username : testapi@hubspot.com
Password : HubSpot
API Key : demo
OAuth Token : demooooo-oooo-oooo-oooo-oooooooooooo
Hub ID : 62515

We can refer contact API as an example. Contact API store lead-specific data which makes it possible to leverage most of the functionalities in HubSpot, from marketing automation, and to lead scoring to smarter contents.

Create a new contact in HubSpot with a simple HTTP POST to the Contacts API. The contact created inside HubSpot, and it had unique ID so we can easily retrieve contact inside of HubSpot later. The API URL is,

'https://api.hubapi.com/contacts/v1/contact?hapikey=' . $hubspot_apikey';

For example :

<?php
  $val = array(
          array(
              'property' => 'email_Id',
              'value' => 'test1@gmail.com'
          ),
          array(
              'property' => 'mob_no',
              'value' => '5587878'
          )
      )
  );
  $json_value= json_encode($val);
  $hubspot_apikey = 'demo';
  $api_url = 'https://api.hubapi.com/contacts/v1/contact?hapikey=' . $hubspot_apikey;
  $c = @curl_init();
  @curl_setopt($c, CURLOPT_POST, true);
  @curl_setopt($c, CURLOPT_POSTFIELDS, $json_value);
  @curl_setopt($c, CURLOPT_URL, $endpoint);
  @curl_setopt($c, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
  @curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
  $response = @curl_exec($c);
  @curl_close($c);
  echo $response;
 ?>

Do you want a marketing help in your business, get a quote now. For more queries get in touch.


RELATED ARTICLE

close

on 11th June 2012 / by jijimol.john
Directi is one of the largest domain registrars on the internet with their services such as ResellerClub, and they provide wonderfully complete to-go solutions for resellers. But there are times when you would want to build upon their platforms rather than just use their entire solution. For this, they provide you the Directi API. You can build upon these as you wish to build out customized solutions of your own. One of the first steps in registering a domain is checking the availability of the domain name you are interested in. DirectI API provides the checkAvailability function for this. function: AssociativeArray checkAvailability (string $userName, string $password, string $role, string $langpref, int $parentid, string $domainName, boolean $suggestAlternative) Inputs: string $userName: Username. string $password: Password. string $role: Role. string $langpref: Language Preference. int $parentid: Parent id. string $domainName: The domainname for which availability is to be checked boolean $suggestAlternative: If this parameter is true, then availability will be checked for all supported TLD's. If it is false, then availability will be checked only for the specified TLD. Returns: AssociativeArray AssociativeArray has the domainname as the key and a AssociativeArray as the value. The inner AssociativeArray has two keys - status and classkey {atestdomain.com={status=regthroughothers, classkey=domcno}} Possible values for the status are: available, regthroughus and regthroughothers. The classkey denotes the TLD type of the domainname. define('DIRECTI_USER', $directi_username); define(DIRECTI_PASSWORD', $directi_password); define('DIRECTI_LANG', 'en'); define('DIRECTI_PARENTID', $directi_parent_id); define('DIRECTI_ROLE', “reseller”); define('SERVICE_URL,'http://soapapi.com/anacreon/servlet/APIv3') /** * Functions for check availabilty of an domain */ function check_domainavailability($domain, $tld) { $DEBUG = TRUE; define('C_DEBUG', $DEBUG); $username = DIRECTI_USER; $password = DIRECTI_PASSWORD; $langpref = DIRECTI_LANG; $parentid = DIRECTI_PARENTID; $role = DIRECTI_ROLE; $domain = $_POST['domain']; $domain_name = explode('.',$domain); $arr_domains= array($domain_name); $available_extensions = array('com', 'us', 'net', 'org', 'biz', 'info', 'ws'); $serviceObj = new DomOrder(path to DomOrder.wsdl lib file); $obj_available_domain = $serviceObj-&gt;checkAvailabilityMultiple($username, $password, $role, $langpref, $parentid, $arr_domains, $available_extensions, TRUE); // $obj_available_domain variable return an array of available and unavailable domains. } Directi API API Integration Domain Registration ResellerClub Leave a reply Your email address will not be published. Required fields are marker *
close

on 13th August 2015 / by fathimath.sajila
The API is allow you to create a functional application or integration quickly and easily. JSON will be returned in all responses from the API, including errors. The API needs two types of authentication, one is OAuth and the other is API keys. We can test API using HubSpot demo portal by signing in using the below credentials. Login: https://login.hubspot.com/login/?loginPortalId=62515 Username : testapi@hubspot.com Password : HubSpot API Key : demo OAuth Token : demooooo-oooo-oooo-oooo-oooooooooooo Hub ID : 62515We can refer contact API as an example. Contact API store lead-specific data which makes it possible to leverage most of the functionalities in HubSpot, from marketing automation, and to lead scoring to smarter contents. Create a new contact in HubSpot with a simple HTTP POST to the Contacts API. The contact created inside HubSpot, and it had unique ID so we can easily retrieve contact inside of HubSpot later. The API URL is, 'https://api.hubapi.com/contacts/v1/contact?hapikey=' . $hubspot_apikey';For example : &lt;?php $val = array( array( 'property' =&gt; 'email_Id', 'value' =&gt; 'test1@gmail.com' ), array( 'property' =&gt; 'mob_no', 'value' =&gt; '5587878' ) ) ); $json_value= json_encode($val); $hubspot_apikey = 'demo'; $api_url = 'https://api.hubapi.com/contacts/v1/contact?hapikey=' . $hubspot_apikey; $c = @curl_init(); @curl_setopt($c, CURLOPT_POST, true); @curl_setopt($c, CURLOPT_POSTFIELDS, $json_value); @curl_setopt($c, CURLOPT_URL, $endpoint); @curl_setopt($c, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); @curl_setopt($c, CURLOPT_RETURNTRANSFER, true); $response = @curl_exec($c); @curl_close($c); echo $response; ?&gt;Do you want a marketing help in your business, get a quote now. For more queries get in touch. API Integration HubSpot Leave a reply Your email address will not be published. Required fields are marker *
Leave a reply
Your email address will not be published. Required fields are marker *

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
The content of this field is kept private and will not be shown publicly.
CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.