Make Generic API Request
Name
generic_request
Description
This is generic endpoint. Use this endpoint when some actions are not implemented by connector. Just enter partial URL (Required), Body, Method, Header etc. Most parameters are optional except URL.
Related Tables
Parameters
Output Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. |
Input Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. |
Examples
SSIS
Use Hubspot Connector in API Source component to read data or in API Destination component to read/write data:
Read from Generic Table (Bulk Read / Write) table using API Destination
This Endpoint belongs to Generic Table (Bulk Read / Write) table, therefore you cannot work with it directly. Use this table and table-operation pair instead:

ODBC application
Use these SQL queries in your ODBC application data source:
Generic Request (Company Search API Example)
This example shows how to invoke generic request when connector file doesnt have specific EndPoint / Table you like to query. This example invokes search endpoint but you can call any valid API endpoint GET/POST etc with this method
SELECT *
FROM generic_request
WITH(
Url='crm/v3/objects/companies/search'
,Filter='$.results[*]'
,RequestContentTypeCode='ApplicationJson'
,RequestMethod='POST'
,RequestData='{
"filters": [ {"propertyName": "hs_lastmodifieddate", "operator": "GT", "value": "<<yearstart-1y||unix_timestamp_ms,FUN_TO_DATE>>" } ],
"properties": ["address","city","state"]
}'
)
Upload File (Generic Request Example)
This example shows how to upload a file using generic request. You might have to add file-manager-permission to your OAuth App else you might get message=This oauth-token (CJT87I6) does not have proper permissions! (requires any of [file-manager-access]). For more information please refer to this link https://developers.hubspot.com/docs/api/files/files
SELECT *
FROM generic_request
WITH(
Url='filemanager/api/v3/files/upload'
, RequestMethod='POST'
, Filter ='$.objects[*]'
, Body='file=@c:\temp\dump.png
folderPath=/
fileName=my_dump.png
options={"access": "PRIVATE", "overwrite": true}'
, IsMultiPart='True'
, Meta='id:long; name:string; title:string; url: string; type:string; size:long; friendly_url:string; meta.allows_anonymous_access:string; meta.indexable:bool'
)
generic_request
endpoint belongs to
__DynamicRequest__
table(s), and can therefore be used via those table(s).
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Generic Request (Company Search API Example)
This example shows how to invoke generic request when connector file doesnt have specific EndPoint / Table you like to query. This example invokes search endpoint but you can call any valid API endpoint GET/POST etc with this method
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT *
FROM generic_request
WITH(
Url=''crm/v3/objects/companies/search''
,Filter=''$.results[*]''
,RequestContentTypeCode=''ApplicationJson''
,RequestMethod=''POST''
,RequestData=''{
"filters": [ {"propertyName": "hs_lastmodifieddate", "operator": "GT", "value": "<<yearstart-1y||unix_timestamp_ms,FUN_TO_DATE>>" } ],
"properties": ["address","city","state"]
}''
)';
EXEC (@MyQuery) AT [LS_TO_HUBSPOT_IN_GATEWAY];
Upload File (Generic Request Example)
This example shows how to upload a file using generic request. You might have to add file-manager-permission to your OAuth App else you might get message=This oauth-token (CJT87I6) does not have proper permissions! (requires any of [file-manager-access]). For more information please refer to this link https://developers.hubspot.com/docs/api/files/files
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT *
FROM generic_request
WITH(
Url=''filemanager/api/v3/files/upload''
, RequestMethod=''POST''
, Filter =''$.objects[*]''
, Body=''file=@c:\temp\dump.png
folderPath=/
fileName=my_dump.png
options={"access": "PRIVATE", "overwrite": true}''
, IsMultiPart=''True''
, Meta=''id:long; name:string; title:string; url: string; type:string; size:long; friendly_url:string; meta.allows_anonymous_access:string; meta.indexable:bool''
)';
EXEC (@MyQuery) AT [LS_TO_HUBSPOT_IN_GATEWAY];
generic_request
endpoint belongs to
__DynamicRequest__
table(s), and can therefore be used via those table(s).