Hubspot Connector
Documentation
Version: 5
Documentation

Table Contacts


Parameters

Parameter Label Required Options Description Help
There are no parameters

Supported Operations

Below section contains supported CRUD operations. Each operation is executed by some EndPoint behind the scene.
Method Supported Reference EndPoint
SELECT get_contacts
INSERT create_contacts
UPDATE update_contacts
UPSERT
DELETE archive_contacts
LOOKUP get_contact

Examples

SSIS

Use Hubspot Connector in API Source component to read data or in API Destination component to read/write data:

Read from Contacts table using API Source

Hubspot
Contacts
SSIS API Source - Read from table or endpoint

Read/write to Contacts table using API Destination

Hubspot
Contacts
Select
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

Get contacts

Gets contacts

SELECT * FROM Contacts --Where Id=123

Get contact by Id

Gets contact by Id

SELECT * FROM Contacts Where Id=51

Insert into Contacts

Inserts contacts

INSERT INTO Contacts(email, firstname, lastname,custom_checkbox, custom_date, custom_number)
VALUES ('john.doe@abc.com', 'John', 'Doe','true','2023-01-01', 100.55)

Update Contacts

Updates contacts in your account

UPDATE Contacts
SET firstname = 'Brian'
   ,lastname = 'Halligan (Sample Contact)'
   --,custom_number=12.12
   --,custom_date='2023-01-01'
   --,custom_string='My Test<<FUN_NOW>>'
   --,custom_richtext='<p><span style="color: #b5b5b5;">##-Please reply-##</span></p>'
   --,custom_multi_select='Blue;Yellow;Black'
   --,custom_pickuser=45581955
   --,custom_dropdown='BB'
   --,custom_checkbox='true'   
WHERE Id = 51

Delete a contact

Deletes a contact

DELETE FROM Contacts Where Id=1234

Create multiple records - (BULK read / write from external source)

This examples shows how to perform bulk update using SOURCE clause. It reads data from external system (in this example MS SQL Server) and sends data to Hubspot using Bulk API

INSERT INTO Contacts 
SOURCE(
  'MSSQL' --ODBC or OLEDB
  ,'Data Source=localhost;Initial Catalog=Test;Integrated Security=true'
  ,' 
    ''bob'' as firstname, ''rock'' as firstname, ''new-email1@abc.com'' as email
    UNION 
    ''sam'' as firstname, ''smith'' as firstname, ''new-email2@abc.com'' as email
)

Delete multiple records - (BULK read / write from external source)

This examples shows how to perform bulk delete using SOURCE clause. It reads data from external system (in this example MS SQL Server) and sends data to Hubspot using Bulk API

DELETE FROM Contacts 
SOURCE(
  'MSSQL' --ODBC or OLEDB
  ,'Data Source=localhost;Initial Catalog=Test;Integrated Security=true'
  ,'select 104897 as Id 
    UNION 
    select 104898 as Id'
)

Update multiple records - (BULK read / write from external source)

This examples shows how to perform bulk update using SOURCE clause. It reads data from external system (in this example MS SQL Server) and sends data to Hubspot using Bulk API

UPDATE Contacts 
SOURCE(
  'MSSQL' --ODBC or OLEDB
  ,'Data Source=localhost;Initial Catalog=Test;Integrated Security=true'
  ,'select 104811 as Id, ''new-email1@abc.com'' as email
    UNION 
    select 104812 as Id, ''new-email2@abc.com'' as email
)

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

Get contacts

Gets contacts

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Contacts --Where Id=123';

EXEC (@MyQuery) AT [LINKED_SERVER_TO_HUBSPOT_IN_DATA_GATEWAY];

Get contact by Id

Gets contact by Id

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Contacts Where Id=51';

EXEC (@MyQuery) AT [LINKED_SERVER_TO_HUBSPOT_IN_DATA_GATEWAY];

Insert into Contacts

Inserts contacts

DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Contacts(email, firstname, lastname,custom_checkbox, custom_date, custom_number)
VALUES (''john.doe@abc.com'', ''John'', ''Doe'',''true'',''2023-01-01'', 100.55)';

EXEC (@MyQuery) AT [LINKED_SERVER_TO_HUBSPOT_IN_DATA_GATEWAY];

Update Contacts

Updates contacts in your account

DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Contacts
SET firstname = ''Brian''
   ,lastname = ''Halligan (Sample Contact)''
   --,custom_number=12.12
   --,custom_date=''2023-01-01''
   --,custom_string=''My Test<<FUN_NOW>>''
   --,custom_richtext=''<p><span style="color: #b5b5b5;">##-Please reply-##</span></p>''
   --,custom_multi_select=''Blue;Yellow;Black''
   --,custom_pickuser=45581955
   --,custom_dropdown=''BB''
   --,custom_checkbox=''true''   
WHERE Id = 51';

EXEC (@MyQuery) AT [LINKED_SERVER_TO_HUBSPOT_IN_DATA_GATEWAY];

Delete a contact

Deletes a contact

DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Contacts Where Id=1234';

EXEC (@MyQuery) AT [LINKED_SERVER_TO_HUBSPOT_IN_DATA_GATEWAY];

Create multiple records - (BULK read / write from external source)

This examples shows how to perform bulk update using SOURCE clause. It reads data from external system (in this example MS SQL Server) and sends data to Hubspot using Bulk API

DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Contacts 
SOURCE(
  ''MSSQL'' --ODBC or OLEDB
  ,''Data Source=localhost;Initial Catalog=Test;Integrated Security=true''
  ,'' 
    ''''bob'''' as firstname, ''''rock'''' as firstname, ''''new-email1@abc.com'''' as email
    UNION 
    ''''sam'''' as firstname, ''''smith'''' as firstname, ''''new-email2@abc.com'''' as email
)';

EXEC (@MyQuery) AT [LINKED_SERVER_TO_HUBSPOT_IN_DATA_GATEWAY];

Delete multiple records - (BULK read / write from external source)

This examples shows how to perform bulk delete using SOURCE clause. It reads data from external system (in this example MS SQL Server) and sends data to Hubspot using Bulk API

DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Contacts 
SOURCE(
  ''MSSQL'' --ODBC or OLEDB
  ,''Data Source=localhost;Initial Catalog=Test;Integrated Security=true''
  ,''select 104897 as Id 
    UNION 
    select 104898 as Id''
)';

EXEC (@MyQuery) AT [LINKED_SERVER_TO_HUBSPOT_IN_DATA_GATEWAY];

Update multiple records - (BULK read / write from external source)

This examples shows how to perform bulk update using SOURCE clause. It reads data from external system (in this example MS SQL Server) and sends data to Hubspot using Bulk API

DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Contacts 
SOURCE(
  ''MSSQL'' --ODBC or OLEDB
  ,''Data Source=localhost;Initial Catalog=Test;Integrated Security=true''
  ,''select 104811 as Id, ''''new-email1@abc.com'''' as email
    UNION 
    select 104812 as Id, ''''new-email2@abc.com'''' as email
)';

EXEC (@MyQuery) AT [LINKED_SERVER_TO_HUBSPOT_IN_DATA_GATEWAY];