Share Your Work

TMD
Member

Python script: download a file submited in a Hubspot form

Hello everyone,

 

I've been developing a python routine able to interpret new emails from Hubspot forms and download the files submitted through the form. What I need to do is to use the URL from the hubspot email that I receive in my mailbox and open it (see code below). This was working until the recent forms update. Can you please help me identify what I need to change so this works again?

Hubspot_email_download_file.PNG

 

Thank you very much.

0 Upvotes
2 Replies 2
LDretzolis
Participant

Python script: download a file submited in a Hubspot form

Hey ! Just wanted to know if you were able to solve your issue ? If yes, would you have a screenshot of your code so that I could use your method ? It would be greatly appreciated

Thanks a lot, 

 

Louis

0 Upvotes
vbrech
HubSpot Employee
HubSpot Employee

Python script: download a file submited in a Hubspot form

Just tested it out, and I think the URL in the email should exactly correspond to the request URL required for this new endpoint: https://developers.hubspot.com/docs/methods/form-integrations/v1/uploaded-files/signed-url-redirect

 

So what that means is that you just need to authenticate your GET request.

 

You could add your portal HAPI key as a query string to the request URL, or otherwise create an app add the OAuth2 flow to your python code.

0 Upvotes