Bulk files and association

Hi!
I’m looking for a way to make a mass import of files, and then make mass associations between companies and the files. Is there a way of doing this in only one API call?
(One call for bulk import of files and one for all associations)

Hi, @DDebortoli :waving_hand: Thanks for reaching out. To confirm, you are not missing an option. You’ll need to make multiple calls. If you can, sharing an example request and the specific endpoints used, can help the community understand if there is a different way to think about your goal or if they can offer any additional suggestions.

Best,

Jaycee

Hi Jayce, thanks for your answer.
What I’m planning to do is use CSM Files API for each file I want to upload
(Methods:

POST/files/v3/files

PUT/files/v3/files/{fileId}

)

Request example:

import requests

import json

post_url = ‘https://api.hubapi.com/filemanager/api/v3/files/upload

filename = ‘example_file.txt’

file_options = {

'access': 'PUBLIC\_INDEXABLE',

"overwrite": False,

'duplicateValidationStrategy': 'NONE',

'duplicateValidationScope': 'EXACT\_FOLDER'

}

files_data = {

'file': (filename, open(filename, 'rb'), 'application/octet-stream'),

'options': (None, json.dumps(file\_options), 'text/strings'),

'folderPath': (None, '/docs', 'text/strings')

}

r = requests.post(post_url, files = files_data,headers = {‘Authorization’:Token})

The problem is that i have to upload/update at least, 10000 files for day or even more.
Woud be usefull a way to upload all files in a single call. Is there a way to upload more than 1 file for call?
The seconds Question:
I saw this: https://community.hubspot.com/t5/APIs-Integrations/How-can-I-attach-a-file-to-contact-via-API/m-p/230159
that is exactly what I want to do, but following the first question, I have to do a high number of associations (1 file belongs to 1 company), so, there is a way of making a lot of associations in just one call?