Use of import from url api to send file from salesforce to hubspot

KRajput4
Member

I am trying to use import from url api of hubspot to send file from salesforce to hubspot.

logic:- Url will be generated from salesforce then hubspot will download file from this url.

But the issue I am facing is that when I upload my 7.8 MB file from salesforce.

In hubspot, it is showing only as a 1 KB file.

Could someone guide is this api the correct way to send file from salesforce to hubspot.

Otherwise what's the use of this api if am unable to send file from salesforce to hubspot?
 

0 Upvotes
1 Accepted solution
CarolinaDeMares
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Hey @KRajput4 ! 

import-from-url/async is the correct endpoint only if HubSpot can fetch the file from a publicly accessible direct-download URL (no auth/cookies), View reference here HubSpot Developers. 

If HubSpot shows ~1 KB, it’s usually saving an HTML/error response (login page / 403 / redirect target) instead of the binary. Salesforce-generated URLs commonly require authentication, so HubSpot can’t retrieve the real file.

To fix: make the URL a true direct-download link that returns the raw bytes with a 200 and correct Content-Length (test via incognito/curl), or use a middleware to pull the file from Salesforce with OAuth and then upload to HubSpot via POST /files/v3/files.

Hope this helps! 

Carolina De Mares

CarolinaDeMares_0-1768149802190.gif

 

 

ZUID.
Goirkekanaaldijk 12 
5046 AT Tilburg 
Nederland

View solution in original post

0 Upvotes
2 Replies 2
CarolinaDeMares
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Hey @KRajput4 ! 

import-from-url/async is the correct endpoint only if HubSpot can fetch the file from a publicly accessible direct-download URL (no auth/cookies), View reference here HubSpot Developers. 

If HubSpot shows ~1 KB, it’s usually saving an HTML/error response (login page / 403 / redirect target) instead of the binary. Salesforce-generated URLs commonly require authentication, so HubSpot can’t retrieve the real file.

To fix: make the URL a true direct-download link that returns the raw bytes with a 200 and correct Content-Length (test via incognito/curl), or use a middleware to pull the file from Salesforce with OAuth and then upload to HubSpot via POST /files/v3/files.

Hope this helps! 

Carolina De Mares

CarolinaDeMares_0-1768149802190.gif

 

 

ZUID.
Goirkekanaaldijk 12 
5046 AT Tilburg 
Nederland

0 Upvotes
KRajput4
Member

Hii @CarolinaDeMares ,

You are absolutely correct.

The mistake I was making was that my url was not downloadable, It was just public sharable link. Once I made it a downloadable URL. My file is perfectly being downloaded in hubspot.

0 Upvotes