Reference

Endpoint Upload File from Local Disk


Name

upload_file

Description

Uploads local file to Hubspot CRM. This API requires files permission for the App (see scopes) [API reference]

Parameters

Parameter Required Options
Name: SourceFilePath

Label: Source File Path

Specify a disk file path
YES
Name: TargetFolder

Label: Target Folder Path

Specify Target folder path. Partially optional field. One of folderPath or folderId must be specified. Path of the folder the file should be uploaded into. Uploading files into the root path “/” is highly discouraged.
YES
Name: AccessType

Label: AccessType

Specify file access type
YES
Option Value
PRIVATE PRIVATE
PUBLIC_NOT_INDEXABLE PUBLIC_NOT_INDEXABLE
PUBLIC_INDEXABLE PUBLIC_INDEXABLE
Name: Overwrite

Label: Overwrite

Specify wheather you like to overwrite target file if exists. If true this file with replace any existing files with the name, folder, and type. Note: If this is set to false, and the uploaded file matches the filename of an existing file in the same folder, the file will be uploaded with a number incremented filename (e.g. example_file.txt will become example_file-1.txt)
YES
Option Value
false false
true true
Name: DuplicateValidationStrategy

Label: DuplicateValidationStrategy

Specify how to handle duplicate target file.
YES
Option Value
NONE NONE
REJECT REJECT
RETURN_EXISTING RETURN_EXISTING
Name: DuplicateValidationScope

Label: DuplicateValidationScope

Specify scope of duplicate validation.
YES
Option Value
EXACT_FOLDER EXACT_FOLDER
ENTIRE_PORTAL ENTIRE_PORTAL
Name: TargetFileName

Label: Target File Name (e.g. MyFile.xlsx)

Specify file name you like to give

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Id DT_I8 bigint
PortalId DT_I8 bigint
Name DT_WSTR nvarchar(50) 50
Size DT_I8 bigint
Height DT_I4 int
Width DT_I4 int
Encoding DT_WSTR nvarchar(1020) 1020
Type DT_WSTR nvarchar(50) 50
Extension DT_WSTR nvarchar(50) 50
CloudKey DT_WSTR nvarchar(500) 500
S3Url DT_WSTR nvarchar(500) 500
FriendlyUrl DT_WSTR nvarchar(500) 500
AltKey DT_WSTR nvarchar(500) 500
AltKeyHash DT_WSTR nvarchar(500) 500
Title DT_WSTR nvarchar(50) 50
MetaUrlScheme DT_WSTR nvarchar(50) 50
MetaAllowsAnonymousAccess DT_BOOL bit
MetaIndexable DT_BOOL bit
Created DT_DBTIMESTAMP datetime
Updated DT_DBTIMESTAMP datetime
DeletedAt DT_DBTIMESTAMP datetime
FolderId DT_I8 bigint
Hidden DT_BOOL bit
CloudKeyHash DT_WSTR nvarchar(500) 500
Archived DT_BOOL bit
CreatedBy DT_WSTR nvarchar(1020) 1020
DeletedBy DT_WSTR nvarchar(1020) 1020
Replaceable DT_BOOL bit
Url DT_WSTR nvarchar(500) 500
AltUrl DT_WSTR nvarchar(500) 500
CdnPurgeEmbargoTime DT_WSTR nvarchar(1020) 1020
FileHash DT_WSTR nvarchar(1020) 1020
If the column you are looking for is missing, consider customizing Hubspot Connector.

Input Columns

Label Data Type (SSIS) Data Type (SQL) Length 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 or in API Destination SSIS Data Flow components to read or write data.

API Source

API Source - Hubspot
Hubspot Connector can be used to integrate Hubspot and your data source, e.g. Microsoft SQL Server, Oracle, Excel, Power BI, etc. Get, write, delete Hubspot data in a few clicks!
Hubspot
Upload File from Local Disk
Required Parameters
Source File Path Fill-in the parameter...
Target Folder Path Fill-in the parameter...
AccessType Fill-in the parameter...
Overwrite Fill-in the parameter...
DuplicateValidationStrategy Fill-in the parameter...
DuplicateValidationScope Fill-in the parameter...
Optional Parameters
Target File Name (e.g. MyFile.xlsx)
SSIS API Source - Read from table or endpoint

API Destination

API Destination - Hubspot
Hubspot Connector can be used to integrate Hubspot and your data source, e.g. Microsoft SQL Server, Oracle, Excel, Power BI, etc. Get, write, delete Hubspot data in a few clicks!
Hubspot
Upload File from Local Disk
Required Parameters
Source File Path Fill-in the parameter...
Target Folder Path Fill-in the parameter...
AccessType Fill-in the parameter...
Overwrite Fill-in the parameter...
DuplicateValidationStrategy Fill-in the parameter...
DuplicateValidationScope Fill-in the parameter...
Optional Parameters
Target File Name (e.g. MyFile.xlsx)
SSIS API Destination - Access table or endpoint

ODBC application

Use these SQL queries in your ODBC application data source:

Upload file from local disk

SELECT * FROM upload_file
WITH
(
    "SourceFilePath" = 'abcd-1234-sourcefilepath',
    "TargetFolder" = '/',
    "AccessType" = 'PRIVATE',
    "Overwrite" = 'true',
    "DuplicateValidationStrategy" = 'NONE',
    "DuplicateValidationScope" = 'EXACT_FOLDER'
)

SQL Server

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

Upload file from local disk

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM upload_file
WITH
(
    "SourceFilePath" = ''abcd-1234-sourcefilepath'',
    "TargetFolder" = ''/'',
    "AccessType" = ''PRIVATE'',
    "Overwrite" = ''true'',
    "DuplicateValidationStrategy" = ''NONE'',
    "DuplicateValidationScope" = ''EXACT_FOLDER''
)';

EXEC (@MyQuery) AT [LS_TO_HUBSPOT_IN_GATEWAY];