Uploading files to Hubspot via API

Hi,

I need to upload a file to Hubspot which I can then attach to a Note. I first need to upload the file, and then mention the id in the Note API.

Referring Hubspot API documentation I see two methods explained:

1) https://legacydocs.hubspot.com/docs/methods/files/v3/upload_new_file mentions using https://api.hubapi.com/filemanager/api/v3/files/upload as the API

2) Accounts Dashboard | HubSpot mentions using Accounts Dashboard | HubSpot as the API.

Are both these correct? Is one preferred over the other?

Appreciate any direction in this regard.

Thank you.

@ClydeJCC , I would recommend working with the the latter (/files/v3/files)

The other version will allow you to create a hidden files and a few other things, but that should not be a concern for you needs.

@dennisedson thank you for the response and the explanation of its use.

Just one clarification. What is the format of the file which is to be uploaded using the /files/v3/files api? Is it base64 or multipart?

@ClydeJCC , I would try multipart :grinning_face: