APIs & Integrations

onvista
Colaborador(a)

Files API - Get List of all files in Folder

resolver

Hey community,

 

just found the new Files Api and checked the endpoints, but couldn't find an endpoint to get a simple list of all files in a specific folder.

 

Something simple like:

GET /files/v3/folders/{folderId}/files

 

Use case:
As a User, I want to see all available files in a folder, So I can click on a file to view it.

 

Can anyone help me out to the the list of files?

0 Avaliação positiva
1 Solução aceita
JBeatty
Solução
Orientador(a) | Parceiro Diamante
Orientador(a) | Parceiro Diamante

Files API - Get List of all files in Folder

resolver

Hi @onvista,

 

You can do this by using the GET/files/v3/files/search endpoint. If you have the folder ID you can preform a get request like:

https://api.hubapi.com/files/v3/files/search?parentFolderId={Your-Folder-ID-Here}&hapikey={Your-hapikey-Here}

Or if you know the path you can do:

https://api.hubapi.com/files/v3/files/search?path={Your-Path-Here}&hapikey={Your-hapikey-Here}

And for reference an example path could look like this(without the quotes): 

"/folder-one/Folder%20Two/"

Notice the %20 URL encoding of a space, and how the path starts and ends with a "/".

✔️ Was I able to help answer your question? Help the community by marking it as a solution.

Joshua Beatty
Software Developer with Pearagon

Still have questions? Let's Talk

Exibir solução no post original

2 Respostas 2
webdew
Orientador(a) | Parceiro Diamante
Orientador(a) | Parceiro Diamante

Files API - Get List of all files in Folder

resolver

Hi @onvista ,

Please follow the below link for files:
Screen shot : https://prnt.sc/1eagrx6
Links : https://legacydocs.hubspot.com/docs/methods/files/get_files_file_id

Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards. 

0 Avaliação positiva
JBeatty
Solução
Orientador(a) | Parceiro Diamante
Orientador(a) | Parceiro Diamante

Files API - Get List of all files in Folder

resolver

Hi @onvista,

 

You can do this by using the GET/files/v3/files/search endpoint. If you have the folder ID you can preform a get request like:

https://api.hubapi.com/files/v3/files/search?parentFolderId={Your-Folder-ID-Here}&hapikey={Your-hapikey-Here}

Or if you know the path you can do:

https://api.hubapi.com/files/v3/files/search?path={Your-Path-Here}&hapikey={Your-hapikey-Here}

And for reference an example path could look like this(without the quotes): 

"/folder-one/Folder%20Two/"

Notice the %20 URL encoding of a space, and how the path starts and ends with a "/".

✔️ Was I able to help answer your question? Help the community by marking it as a solution.

Joshua Beatty
Software Developer with Pearagon

Still have questions? Let's Talk