APIs & Integrations

JokersWild
Member

.Net C# downloading files

SOLVE

I am trying to download files from our HubSpot account, using the URL given for the file.  I have tested with HTTPWebRequest and with WebClient.  Using WebClient I get the file but it is blank, and if I use HTTPWebRequest I get a response of "error: (503) Server Unavailable".  The download works fine if I use a web browser and enter the URL, just not working through my .NET program.  I was curious if anyone has been able to do this, or if HubSpot secruity is stopping this from happening.

0 Upvotes
1 Accepted solution
JokersWild
Solution
Member

.Net C# downloading files

SOLVE

I found my issue, I was getting the URL from the https://developers.hubspot.com/docs/methods/form-integrations/v1/uploaded-files/signed-url-redirect

When receiving this it shows hubspot.com instead I needed hubapi.com and also it does not have the hapikey at the end.  Once I added those to the string I was able to download.

View solution in original post

0 Upvotes
1 Reply 1
JokersWild
Solution
Member

.Net C# downloading files

SOLVE

I found my issue, I was getting the URL from the https://developers.hubspot.com/docs/methods/form-integrations/v1/uploaded-files/signed-url-redirect

When receiving this it shows hubspot.com instead I needed hubapi.com and also it does not have the hapikey at the end.  Once I added those to the string I was able to download.

0 Upvotes