You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but it is unclear how the options argument is to be passed in. Does anyone know?
I currently have the following, which is not working: await hubspotClient.files.filesApi.upload( { data: file, name: 'test upload' }, '160809862233', {access: 'PUBLIC_NOT_INDEXABLE'} );
The text was updated successfully, but these errors were encountered:
Hey @MattVaughan-Jones I ran into the same issue and I was able to get past it, hope this helps! I rammed my head against my keyboard late into the night but I was able to find an older version of the API docs and found a definition for the options object here: https://legacydocs.hubspot.com/docs/methods/files/v3/upload_new_file. Scroll down to the options object heading. Below is an example of what I ended up writing that worked.
constfile=fileBufferconstfileName='file.pdf'constoptions=JSON.stringify({access: 'PRIVATE',overwrite: false})constres=awaithsClient.files.filesApi.upload({data: file,name: fileName},undefined,'/generated-files',fileName,undefined,options)// notice that there are "undefined" values declared for the arguments that I did not want to set
On another note though, this is either a documentation fail or maybe there were supposed to be some defaults set that would allow this to be optional. In either case, this is a bug that needs to be addressed.
All arguments are optional in the type declaration file, but I receive an error saying that
options
is a required field.The declaration file stipulates:
upload(file?: HttpFile, folderId?: string, folderPath?: string, fileName?: string, charsetHunch?: string, options?: string, _options?: Configuration): Promise<any>;
but it is unclear how the options argument is to be passed in. Does anyone know?
I currently have the following, which is not working:
await hubspotClient.files.filesApi.upload( { data: file, name: 'test upload' }, '160809862233', {access: 'PUBLIC_NOT_INDEXABLE'} );
The text was updated successfully, but these errors were encountered: