How to upload multiple files at the same time via api
We can upload file (https://legacydocs.hubspot.com/docs/methods/files/v3/upload_new_file) mentioned in the article, but if I have multiple files, I have to call the api request n number of time ( n = no. of files). I'm looking for a quick way, where I can achieve this in single api call.
How to upload multiple files at the same time via api
Hello @tme, I was able to investigate more about it and when looking to pass multi-files you are able to use the HubSpot Form APIs, you would need to send the same field for each file, example:
var data ={
"fields":[
{
"name":"email",
"value":"getEmail"
},
{
"name":"filemulti",
"value":"https://file-url.jpg"
},
{
"name":"filemulti",
"value":"https://file-url2.jpg"
]
}
where we can submit different files at the same time, and don't have to worry about uploading the files.
What we're trying to do is, instead of using HubSpot form, we want to use our custom form for a better user experience, and submit the form data using API (the file will be in binary format). Right now we are trying to use this API endpoint
'https://api.hsforms.com/submissions/v3/integration/submit/:portalID/:formGuid', but its content-type is application/json and we can't send a binary string (file data) to it, based on your solution we have to upload these files somewhere (like Hubspot), and then provide the URL of that file, which is working. But we want to implement it as you do it using your internal API endpoint. is it possible? do you have any public API endpoint like it? if No, is this is the only way to do it (first upload files on Hubspot using file upload API and submit the form by providing that URL)?