cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Organizing your research is important to easily review and share it. Learn how Kim uses Dropbox to gather and organize her research right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
1
Ask
2
Comments

How to list the contents of a team folder?

How to list the contents of a team folder?

sreeraj
Explorer | Level 3

I am using dropbox business account and API v2.0. I have team folder with many subfolders and files in it. When I call the api /team_folder/list I get the name of the team folder. But how do I get list the contents (both files and folders) of a teamfolder? I couldnt find any related api calls in the team section in the documentation - https://www.dropbox.com/developers/documentation/http/teams#team-team_folder-list.

Please advice.

 

Also, please let me know if there is any PHP sdk available for Business API. Currently I am using HTTP api requests.

 

Thanks.

1 Accepted Solution

Accepted Solutions

Re: How to list the contents of a team folder?

Greg-DB
Dropboxer
In order to list the contents of a folder, such as a team folder, you should use /2/files/list_folder[/continue]:

https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder-continue

Note that this is a user endpoint, so if you have a Business API app, you'd need to have the "team member file access" permission and use the "member file access" feature:

https://www.dropbox.com/developers/documentation/http/teams#teams-member-file-access

We don't have an official PHP SDK for Dropbox API v2, but you can use a third party library:

https://www.dropbox.com/developers/documentation/communitysdks

Or, you can call the HTTPS endpoints themselves, as you have been:

https://www.dropbox.com/developers/documentation/http/documentation

View solution in original post

6 Replies 6

Re: How to list the contents of a team folder?

Mark
Super User II
*moves to API forum*

 


:penguin::penguin: - :penguin: - :penguin: - :penguin:


Heart Did this post help you? If so please mark it for some Kudos below. 


:white_check_mark: Did this post fix your issue/answer your question? If so please press the 'Accept as Solution' button to help others find it.


:arrows_counterclockwise: Did this post not resolve your issue? If so please give us some more information so we can try and help - please remember we cannot see over your shoulder so be as descriptive as possible! 


 

Re: How to list the contents of a team folder?

Greg-DB
Dropboxer
In order to list the contents of a folder, such as a team folder, you should use /2/files/list_folder[/continue]:

https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder-continue

Note that this is a user endpoint, so if you have a Business API app, you'd need to have the "team member file access" permission and use the "member file access" feature:

https://www.dropbox.com/developers/documentation/http/teams#teams-member-file-access

We don't have an official PHP SDK for Dropbox API v2, but you can use a third party library:

https://www.dropbox.com/developers/documentation/communitysdks

Or, you can call the HTTPS endpoints themselves, as you have been:

https://www.dropbox.com/developers/documentation/http/documentation

Re: How to list the contents of a team folder?

hsin
Explorer | Level 4

According to this article: https://www.dropbox.com/help/business/team-folders

 

I believe that there're two kinds of Dropbox Business Account:

  • A: the Dropbox Business account created a long time ago.
  • B: the Dropbox Business account created recently. => with Team Space

 

The /2/files/list_folder lists all the files include team folders of A.

But the /2/files/list_folder lists only the files in the purple folder (private folder) of B.

 

Is there any way to list team folders and their contents of B's Team Space?

Thank you!

Re: How to list the contents of a team folder?

Greg-DB
Dropboxer

@hsin Yes, that's correct. For the newer type B, please refer to the namespace guide, which covers how to access the team space:

 

https://www.dropbox.com/developers/reference/namespace-guide

Re: How to list the contents of a team folder?

msullybos
Explorer | Level 3

For files/list_folders, can you use the team_folder_id in place of the path?

Thanks

Re: How to list the contents of a team folder?

Greg-DB
Dropboxer

@msullybos Yes, the /2/files/list_folder endpoint supports namespace ID paths in the 'path' parameter, so you can use the team_folder_id for a team folder as the 'path' value, like "ns:123456789", where 123456789 is the team_folder_id. (For information on how to interact with a team space though, refer to the Team Files Guide.)

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    msullybos Explorer | Level 3
  • User avatar
    hsin Explorer | Level 4
What do Dropbox user levels mean?
Need more support?